Java Tutorial 12 - Input and Output (Remastered)

Published: 12 March 2020
on channel: Ken
47
1

// Input
double pizzaPrice = 5.95;
int quantity = 0;
double total = 0.0;
String orderMessage = "How many pizza do you want to order? ";
Scanner input = new Scanner(System.in);

// Process
System.out.println(orderMessage);
quantity = input.nextInt();
total = pizzaPrice * quantity;

// Output
System.out.println("Your Order");
System.out.println(pizzaPrice + " " + quantity);
System.out.println("Total: " + total);
System.out.println("Thank you!");// Input
double pizzaPrice = 5.95;
int quantity = 0;
double total = 0.0;
String orderMessage = "How many pizza do you want to order? ";
Scanner input = new Scanner(System.in);

// Process
System.out.println(orderMessage);
quantity = input.nextInt();
total = pizzaPrice * quantity;

// Output
System.out.println("Your Order");
System.out.println(pizzaPrice + " " + quantity);
System.out.println("Total: " + total);
System.out.println("Thank you!");


On this page of the site you can watch the video online Java Tutorial 12 - Input and Output (Remastered) with a duration of hours minute second in good quality, which was uploaded by the user Ken 12 March 2020, share the link with friends and acquaintances, this video has already been watched 47 times on youtube and it was liked by 1 viewers. Enjoy your viewing!