Java programming Language Fundamentals Chapter III to redeem yourself

Source: Internet
Author: User

Package cn.save;

Import Java.util.Scanner;

public class Myshop {
public static void Main (string[] args) {
System.out.println ("\ T" + "Welcome to use your own shopping management system");
Scanner input = new Scanner (system.in);
System.out.println ("\t\t" + "1. Login system" + "\ n" + "\t\t" + "2. Exit");
System.out.println ("*******************************************");
int num = Input.nextint ();

Switch (num) {
Case 1:
System.out.println ("\ T" + "1. Customer information management");
System.out.println ("\ T" + "2. Shopping settlement");
System.out.println ("\ T" + "3. True feedback");
System.out.println ("\ T" + "4. Logout");
int num1 = Input.nextint ();
Switch (NUM1) {
Case 1:
SYSTEM.OUT.PRINTLN ("Shopping System > Customer Information Management");
System.out.println ("\ T" + "1. Show all customer Information");
System.out.println ("\ T" + "2. Add customer Information");
System.out.println ("\ T" + "3. Modify customer Information");
System.out.println ("\ T" + "4. Query customer Information");
Break
Case 3:
SYSTEM.OUT.PRINTLN ("Shopping management System > True feedback");
System.out.println ("\ T" + "1. Lucky Big Broadcast");
System.out.println ("\ T" + "2. Lucky Draw");
System.out.println ("\ T" + "3. Birthday Greetings");
System.out.println ("\ T" + "4. Redemption offer");

System.out.print ("Please enter consumption amount:");
Double JE = input.nextdouble ();
System.out.print ("whether to participate in preferential redemption Live:");
String num2 = Input.next ();
System.out.println (NUM2);

if (num2.equals ("yes")) {
If (JE >= 200) {
System.out
. Print ("Redeem Pepsi 1 500ml cola 2 5kg flour 3 Supor vegetable Pot 4 L ' oreal Toner 5");
int num3 = Input.nextint ();
Switch (num3) {
Case 1:
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (je+2));
SYSTEM.OUT.PRINTLN ("Successfully swapped 1 bottles of Pepsi Cola Beverage");
Break
Case 2:
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (je+3));
SYSTEM.OUT.PRINTLN ("Successfully redeem 500ml Coke 1 bottles");
Break
Case 3:
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (JE+10));
SYSTEM.OUT.PRINTLN ("Successfully swapped for 5kg flour");
Break
Case 4:
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (JE+10));
System.out.println ("Successful redemption of Supor vegetable Pot One");
Break
Case 5:
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (JE+20));
System.out.println ("Successful redemption of L ' oreal toner Bottle");
Break
}
} else if (> je & JE >= 100) {
System.out
. Print ("Redeem Pepsi 1 500ml cola 2 5kg flour 3 Supor vegetable Pot 4 L ' oreal Toner 5");
int num4 = Input.nextint ();
Switch (NUM4) {
Case 1:
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (je+2));
SYSTEM.OUT.PRINTLN ("Successfully swapped 1 bottles of Pepsi Cola Beverage");
Break
Case 2:
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (je+3));
SYSTEM.OUT.PRINTLN ("Successfully redeem 500ml Coke 1 bottles");
Break
Case 3:
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (JE+10));
SYSTEM.OUT.PRINTLN ("Successfully swapped for 5kg flour");
Break
}
} else if (> JE & je >= 50) {
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (je+2));
SYSTEM.OUT.PRINTLN ("Successfully swapped 1 bottles of Pepsi Cola Beverage");
}

else {
SYSTEM.OUT.PRINTLN ("Total amount of this consumption:" + (je+0));
System.out.println ("Welcome next visit");
}
}

}
Break
Case 2:
System.out.println ("Welcome next visit");
Break
Default
SYSTEM.OUT.PRINTLN ("input error");

}
}
}

Java programming Language Fundamentals Chapter III to redeem yourself

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.