6, the topic under:

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.