Prompt the user for pairs of inputs of a product number

Assignment Help Computer Engineering
Reference no: EM132200521

Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold (this is two separate prompts for input values).

You must use a switch statement and a sentinel-controlled loop (i.e. a loop that stops execution when an out of range value, such as -1, is input).

All 15 items below are for a single purchase. There are five sets of inputs as follows:

Product 1 1 unit (cost is $2.98 per unit)

Product 2 2 units (cost is $4.50 per unit)

Product 3 3 units (cost is $9.98 per unit)

Product 4 4 units (cost is $4.49 per unit)

Product 5 5 units (cost is $6.87 per unit)

Your application must show the user's input of each pair of product number and quantity, the calculated line cost for that product, and the cumulative order cost so far. Then, after the sentinel value is input your program must display the total retail cost for the full order.

For full possible credit you must show all 11 user inputs (5 product number and quantity pairs and the sentinel value) and all the corresponding program outputs, not just a subset of the inputs and outputs. Showing just a subset of all required inputs and outputs will result in lost points.

Reference no: EM132200521

Questions Cloud

Write a java method which takes a 2-darray of double : Write a Java method, findAverages, which takes a 2-dimensional array of double as a parameter and returns a 1-dimensional array of double containing.
Write a java gui application which can take a date : Write a Java GUI application, which can take a date (no earlier than 1900) from a user and show its corresponding day of the week.
Prompt the student to enter their user name and password : Prompt the student to enter their user name and password. Read a file that contains a list of all students' information to validate the login credentials.
Read an input file containing text and a single word : Write a Java application that reads an input file containing text and a single word.
Prompt the user for pairs of inputs of a product number : Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold.
Write a code program with a loop that lets the user enter : Write a java code program with a loop that lets the user enter a series of positive integers.
Calculate the time required for each of three trip : Prompts the user for destination, number of miles driven, and speed driven (both as integer values).
Demonstrate your work : The driver class should create Pizzas of various sizes and demonstrate that all the methods work correctly.
Check whether an array of integers is gigantic not : Write a Java method that checks whether an array of integers is gigantic not.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Display all of the values in a table

Prompt the user for a string, and display the corresponding number. For example, if the user types "five", the program would output.

  Illustrate your understanding of an access control matrix

Using a sample scenario (e.g. University System), illustrate your understanding of an Access Control matrix along with inclusion of access rights.

  Prompts the user to enter a number and prints the number

Write a C++ program that prompts the user to enter a number and prints the number and a message that states.

  Describe five major tasks each with one to two subtasks

Define five major tasks, each with one to two subtasks. Also write a brief description for each task. Create a Gantt chart illustrating the project tasks.

  How can distance be beneficial to groups and teams

What are the major effects of the physical separation of group members? How can distance, in some cases, be beneficial to groups and teams?

  How would you build a csirt

How would you build a CSIRT? What are the components to building an effective team? DQ requirement: We recommend your initial posting to be between 200-to-300.

  Define a variable called boat-times-file that is direct file

Define a variable called Boat_Times_File that is a direct file of Interval values. Decide what form of data structure is appropriate for the given problem.

  Program to evaluate case statement

Program to evaluate case statement

  Find the rest are in the kitchen for the chef''s staff.

throughout Phase One of this project, your job is to set up the Windows Server 2003 and train two of the management staff on its operation.

  Problem on bubble sort algorithm

Problem on Bubble sort algorithm

  Describe the manner in which you can employ the purchased

imagine you are an administrator for a large corporation that has just purchased a new company. to access some of the

  Build a login screen which will be passed an id and password

Build a login screen which will be passed an id and password.If the user fails to login in three tries, have them authentic based on their personal information.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd