import java.util.Scanner;
public class Main {
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
do {
System.out.print("Would you like to know your Total Quarterly Salary? Press 1 if yes or Press 2 if no! ");
int ch = sc.nextInt();
switch (ch)
{
case 1:
System.out.println ("Enter Quarter's Salary of Region 1: ");
int regiona = sc.nextInt();
System.out.println ("Enter Quarter's Salary of Region 2: ");
int regionb = sc.nextInt();
System.out.println ("Enter Quarter's Salary of Region 3: ");
int regionc = sc.nextInt();
int kys = regiona + regionb + regionc;
System.out.println ("Your Total Quarterly Salary is " +kys+ "!");
if (kys > 5000) {
System.out.println ("This year's Quarterly Sales are greater than the previous sales.");
}
else {
System.out.println (" ");
System.out.println ("This year's Quarterly Sales are lesser than the previous sales.");
}
break;
}
}
while(true);
{
int ch2 = sc.nextInt();
switch (ch2)
{
case 2:
System.out.println (" ");
System.out.println ("***********************");
System.out.println ("This program has ended!");
break;
default:
System.out.println (" ");
System.out.println ("***********************");
System.out.println ("This program has ended!");
}
}
}
}