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

  Describe the different methods of raid

Compare mean time between repair (MTTR) and mean time between failures (MTBF). Why can more components actually mean less reliability?

  Provide a definition of the exp function

E19: Numerical Methods for Engineering Applications Spring 2016 - HOMEWORK 9. In either case, you will need to provide a definition of the exp function which handles dual numbers correctly (see sqrt and cos in dual.py for examples)

  Identify vulnerabilities within source code

List different methods to identify vulnerabilities within source code. What specific items should committee members looking for when considering vulnerability?

  Write a query that returns the cuisine type of restaurant

Write a query that uses the index created in part b to return all the restaurants containing the term "Rabbit" in their name.

  Write in pseudo-code the siftdown algorithm

A ternary max-heap is similar to the binary max-heap that we have discussed in class, but now non-leaf nodes can have 3 children instead of 2.

  analyze algorithms for performing th methods of set ADT

Describe and analyze efficient algorithms for performing the methods of the set ADT assuming this representation.

  Write the definition of a class counter containing variable

A method named decrement that subtracts one from counter. It also does not take parameters or return a value .

  What makes man different from a lan and a wan

What is a MAN and what makes it different from a LAN and a WAN? Distinguish between the Internet backbone and an Internet service provider (ISP).

  Develop the abstract rtn for the x or command

Develop the abstract RTN for the x or command. Write concrete RTN step and control sequences for the brl instruction implemented in the I-bus microarchitecture.

  Evaluate each point to determine the most important three

Imagine only three points are to be rolled out in the first phase. Evaluate each point to determine the most important three for the initial rollout phase.

  Explain how cloud service models

Explain how Cloud Service Models (IaaS, SaaS, PaaS) and How Microsoft Office 365, Azure Fit In? Explain the AWS?

  Do you think sqa plan is just busy work

What is your opinion about SQA plan, do you think SQA plan is just busy work, or does it really pay off?

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