Kann mir bitte jemand helfen? Wie kann ich alle Artikel drucken, die ich nutzen werde? Vielen Dank im Voraus :)Drucken aller Artikel
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String choice;
String want = "";
double price, total = 0, payment, change;
System.out.println("Beauty Zone Salon");
System.out.println("Welcome Customer");
System.out.println("Hair Cut......100");
System.out.println("Manicure......200");
System.out.println("Pedicure......300");
do {
System.out.print("Enter your choice: ");
choice = input.nextLine();
if (choice.equalsIgnoreCase("Haircut")) {
System.out.println("You choose Haircut");
price = 100;
total = total + price;
System.out.print("Do you want to do another service?");
want = input.nextLine();
} else if (choice.equalsIgnoreCase("Manicure")) {
System.out.println("You choose Manicure");
price = 200;
total = total + price;
System.out.print("Do you want to do another service?");
want = input.nextLine();
} else if (choice.equalsIgnoreCase("Pedicure")) {
System.out.println("You choose Pedicure");
price = 300;
total = total + price;
System.out.print("Do you want to do another service?");
want = input.nextLine();
}
} while (want.equalsIgnoreCase("Y"));
System.out.println("ITEMS\n");
System.out.println("Your total due is " + total);
System.out.print("Enter amount of your payment:");
payment = input.nextDouble();
change = payment - total;
System.out.println("Your change is: " + change);
System.out.println("Goodbye");
}
Können Sie Ihren Code in einem lesbaren Format haben. – randominstanceOfLivingThing