Question: Introduction to Programming for Computer Scientists home > 3.10: LAB: Output with groupings: Vending machine (branches) E zyBooks cata 3.10 LAB: Output with groupings: Vending

Introduction to Programming for Computer Scientists home > 3.10: LAB: Output with groupings: Vending machine (branches) E zyBooks cata 3.10 LAB: Output with groupings: Vending machine (branches) A vending machine serves chips, fruit, nuts juice, water and coffee. The machine owner wants a daily report indicating what items sold that day. Given boolean values (true or false) indicating whether or not at least one of each item was sold in the order chips, fruit, nuts, juice, water, and coffee), output a list for the owner. If all three snacks were sold output All snacks' instead of individual snacks. Likewise, output "All-drinks' if appropriate. For coding simplicity, output a space after every item, including the last item, Ex: If the input is false false true true true false, output Nuts Juice Water Ex If the input is true true true false false true, output: All-snacks Coffee Ex If the input is true true true true true true, output: All-snacks All-drinks Ex If the input is false false false false false false, output No items ACTIVITY 3.10.1: LAB: Output with groupings: Vending machine (branches) 0/10 LabProgram java Load default template... port java.util.conner: 3 public class LabProgram { public static void main(String args) { Scenner sehr = new Scanner(System.in); boolean chips Sold Snack itens boolean fruit Sold; boolean nutssold; booleon juicefold: Drink itens boolean watersold: boolean coffeeSold; chipssold - ser.nextBoolean(; frutt sold schnextBoolean ; nutssold - scnr.next Boolean(); juiceSold - ser.nextBoolean watersold - ser nextBoolean coffee sold ser.nextBlooleon : Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Students: This content is controlled by your instructor, and is not zyBooks content Direct questions or concerns about this content to your instructor if you have any technical issues with the zyLab submission system, use the Trouble with lab button at the bottom of the lab. 32.8 Ch. 03 Sort Three Numbers (nested if) Write a program to ask the user for three numbers (double type) and print the three numbers in Descending order (from large to small) Sample input/output should looks like the follows. please enter three numbers 20.1, 13.4, 3.65 in double type): 3.65 20.1 13.4 ACTIVITY 32.8.1: Ch 03 Sort Three Numbers (nested in 3281 Ch 08. 0/3 NumbersInDescending Order.java import java.util.Scanner: public class NumbersInDescendingOrder public static void main(String[] args) Scanne kbd new Scanner(System.in); System.out.println("Please enter three numbers in double type): int numi - kbd.nextInt() int num2 kbd.nextInt() int num) kd.nextInt() ): largesellul, num2, num) public static void largeSallintone, int two, int three) (one to two three) System.out.println(on two three else if(t ) one three) System.out.println(the one three) three the two one) System.out.se intin(three t o ne) System.out.println(one
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
