When a travel agent bookings with the airline, the airline will give a certain discount according to the booking amount.
The larger the booking volume, the higher the discount. If the booking amount is less than 10, the discount rate is 10%;
If the booking amount is greater than or equal to 10 sheets and less than 20, the discount rate is 15%; booking quantity
If it is greater than or equal to 20 sheets and less than 30, the discount rate is 30%, the booking amount equals or exceeds 30, and the highest
The 45% discount. Try to write a program that calculates and outputs the available discount rate based on the booking amount entered by the user
The procedure is as follows:
public class Test {//Definition class
public static void Main (string[] args) {//main function, entry of program
System.out.print ("Please enter your booking amount:");
Scanner s = new Scanner (system.in);
int t;
t = S.nextint ();
if (T < 10) {
System.out.println ("Your discount rate is: 10%");
}
if (t >= && T < 20) {
System.out.println ("Your discount rate is: 15%");
}
if (t >= && T < 30) {
System.out.println ("Your discount rate is: 30%");
}
if (T >= 30) {
System.out.println ("Your discount rate is: 45%");
}
}
}
6, the topic under: