print 25 for n=3 Happy sad happy where n is no of elements it seems to print total_score as 0 every time also mention the reason i am facing this problem thanks for the help in advance
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Mood {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n= sc.nextInt();
HashMap<Integer, String> hmap = new HashMap<>();
/* for (int i = 0; i < n; i++) {
Integer a = sc.nextInt();
String b = sc.next();
hmap.put(a, b);
}*/
String[] string = new String [n];
sc.nextLine();
for (int i = 0; i < n; i++)
{
string[i] = sc.nextLine();
}
/* HashMap<String, Integer> mood = new HashMap<>();
mood.put("Happy",10);
mood.put("Sad",5);
mood.put("Neutral",2);
mood.put("None",1);*/
int Total_score=0;
for (int i = 0; i <n ; i++) {
if(string[i]=="Happy"){
Total_score=Total_score+10;}
else if (string[i]=="Sad"){
Total_score=Total_score+5;}
else if (string[i]=="Neutral"){
Total_score=Total_score+2;}
else if (string[i]=="None"){
Total_score=Total_score+1;}
else
break;
}
System.out.println(Total_score);
}
}