
WAP to calculate commison earned by a agency on the following tour pacages. trip to goa-15% trip to mumbai-25%

Hi Friend,
Try the following code:
import java.util.*;
class CalculateCommission{
public static void main(String[] args)
{
double goapackage=30000;
double mumpackage=50000;
double goacomm=0;
double mumcomm=0;
Scanner input=new Scanner(System.in);
System.out.println("1 Trip to Goa");
System.out.println("2 Trip to Mumbai");
System.out.println("3 Exit");
System.out.println();
boolean exit=false;
do{
System.out.print("Enter your choice: ");
int choice=input.nextInt();
switch(choice){
case 1:
goacomm=goapackage*0.15;
System.out.println("Commission for Goa is: "+goacomm);
break;
case 2:
mumcomm=mumpackage*0.25;
System.out.println("Commission for Mumbai is: "+mumcomm);
break;
case 3:
exit=true;
}
}
while(!exit);
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.