import java.util.
Scanner;
class Welfare{
public static void main(String []args){
Scanner sc = new Scanner(System.in);
double salary, category1, category2, category3, totalcollection=0, totalcategory1=0,
totalcategory2=0, totalcategory3=0;
int staff=0, numcategory1=0, numcategory2=0, numcategory3=0;
while(staff<20){
System.out.print("Enter Salary: ");
salary = sc.nextDouble();
if(salary<1000){
category1 = salary*0.02;
numcategory1 = numcategory1 + 1;
totalcategory1 = totalcategory1 + category1;
totalcollection = totalcollection + category1;
}
else if(salary<=2500){
category2 = salary*0.03;
numcategory2 = numcategory2 + 1;
totalcategory2 = totalcategory2 + category2;
totalcollection = totalcollection + category2;
}
else {
category3 = salary*0.05;
numcategory3 = numcategory3 + 1;
totalcategory3 = totalcategory3 + category3;
totalcollection = totalcollection + category3;
}
staff = staff + 1;
}
System.out.println("Total collection for the month: "+totalcollection);
System.out.println("Total collection by gross salary less than RM1000.00: "+totalcategory1);
System.out.println("Total collection by gross salary between RM1000.00 - RM2500.00:
"+totalcategory2);
System.out.println("Total collection by gross salary more than RM 2500.00:
"+totalcategory3);
System.out.println("The number of staff by gross salary less than RM 1000.00:
"+numcategory1);
System.out.println("The number of staff by gross salary between RM 1000.00 - RM 2500.00:
"+numcategory2);
System.out.print("The number of staff by gross salary more than RM 2500.00: "+numcategory3);
}}