Write a program that prompts the user to enter goods sale information including the name of the goods, quantity, and amount. First, the user is required to input the number of goods, and then input goods sale information one by one. Then the program will print out the goods information sort by quantity (from largest to smallest), and sort by amount (from largest to smallest) respectively.
Here is a sample run:
<Output>
Enter the number of goods:3
--------------------------------
Enter information for item 1
Name:Book
Quantity:14
Amount(in USD):856.89
--------------------------------
Enter information for item 2
Name:CD
Quantity:32
Amount(in USD):459.20
--------------------------------
Enter information for item 3
Name:T-Shirt
Quantity:22
Amount(in USD):650.80
--------------------------------
Sort by quantity:
--------------------
Item Qty Amount
CD 32 459.20
T-Shirt 22 650.80
Book 14 856.89
--------------------
Sort by amount:
--------------------
Item Qty Amount
Book 14 856.89
T-Shirt 22 650.80
CD 32 459.20
--------------------
<End Output>
I have 9+ years of exp in java j2ee hibernate spring webservices databases. Done multiple projects like this and almost proficient in design patterns..Checkout my reviews, all projects were completed successfully.
$10 USD in 1 day
5.0 (83 reviews)
6.0
6.0
4 freelancers are bidding on average $11 USD for this job