Professional Documents
Culture Documents
do{
strDays = JOptionPane.showInputDialog(null,"Please enter No. of working days: (>0 and <42)",
"Allowance", JOptionPane.INFORMATION_MESSAGE);
days = Integer.parseInt(strDays);
if(days<0 || days>42) System.out.println("No. of working days should >0 and <42. Please enter
again.");
if (days==0) {//enter 0 to quit the program
System.out.println("Thank you for using Allowance Calculating Application.");
System.exit(0);
}
}while (days<0 || days>42);//if days <0 or >42, enter days again
System.out.println("For an internship student who worked "+days +" days with daily allowance
$"+dAllowance+", his total allowance is $"+calAllowance(dAllowance,days));
System.exit(0);
}