Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Christopher Hancock

Greenhorn
+ Follow
since Jan 27, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Christopher Hancock

I think that it already does this but I would like it to add all the totals together and output it to show the total cost of all the products combined
8 years ago
how would I write that and where should it go?
8 years ago
Please Help!

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. 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 calculate and display the total retail value of all products sold, after all 5 pairs of inputs are completed. You must also display the total after each new pair of input values is entered.

Here is what I have so far...It works ,however, I want to add in the final message window the total of the entire order.



Thanks Collin





8 years ago