Design and create programs using control structures


Your program must provide a menu to the user. This menu should list five different products of your choice. Once the user selects one product, they should specify which state they are located. The state choices should include CT, VT, WI, CA and WA. State taxes vary for each state . The user should then specify the desired number of cases . The appropriate state tax should be added to the total cost of the product . Next, using the Math class random method, generate 20 numbers ranging between 1-100. Ensure there are no duplicates.

  • Display the following to the user.
  • Name of the product selected
  • Number of cases
  • Number of items
  • Subtotal (units * price per unit)
  • State tax (with the percentage and state abbreviation in parentheses),
  • Total cost (subtotal plus state tax)
  • The table of random numbers displayed in a table of five numbers per row

You need to use at least one repetition statement, one selection statement, Scanner class, at least one array and the random method in this code. For generating random numbers you should use the random () static method of class Math. It returns a double so you will need to cast it as an integer. For example,

number = (int) ( range * Math.random () ) + 1;

  • Your assignment submittal should include your Java program with commented Java source code files.
  • This assignment will also be assessed using additional criteria provided here.
  • Objective       
  • Use loops and decision structures in programs   
  • Design and create programs using control structures    
  • Use arrays, strings, and other common data types

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Design and create programs using control structures
Reference No:- TGS0531365

Expected delivery within 24 Hours