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

  What are the four basic end-user environments

List and explain five application risks. How can applications become incompatible systems? What are the four basic end-user environments?

  Explain how cache memory is used within virtual memory

Explain how cache memory is used within Virtual memory. You must provide detailed information about the use of cache memory in virtual memory.

  Write a program that plays tic-tac-toe

Write a program that plays tic-tac-toe. The tic-tac-toe game is played on a 3 × 3 grid as in the photo at right.

  What setting did you use for findhomography

write-up describing your approach. Do the images align well? If not, why? Does adding more points to the set improve alignment? What setting did you use for findHomography? Is there a particular setting that worked better than the others

  Write a code in c that will partition your pic32 32kb ram

Write a code in C that will partition your PIC32 32KB RAM into four equal segments (8KB each) for the kernel data, kernel program.

  Discuss the systems development life cycle

Outline the planning, analysis, design, and implementation phases. Develop in accordance with the systems development life cycle (SDLC).

  Questiongenerate and display all 52 cards in a standard

questiongenerate and display all 52 cards in a standard deck of playing cards 2-10 j k q a of hearts diamonds clubs and

  Finds would cause damage to national security

Write review on this. Today in order to make face the increasing rate of data breaches in the companies, there is widespread agreement about the interests of participants

  The average of the even elements of the array

Write a function double average(int arr[] , int n), that returns the average of the even elements of the array.

  Plot the six histograms in a single graphics window

Remember that all figures have exactly the same underlying distribution. Plot the six histograms in a single graphics window and label them accordingly.

  Write a program that prompts the user for an integer

Write a program that prompts the user for an integer and then prints out all prime numbers up to that integer.

  Write a program that will collect data from bluetooth device

Using arduino, write a program that will collect data from Bluetooth devices and store the information in a database.

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