Write a C++ program that helps the user plan out their budget. It should ask the user for the most recent 5 things that they bought; it should ask for both the name for the item and its price. Then, print out the following: total money spent, average money spent per item, lowest priced item, and highest priced item. You can assume that each item has a different name and a different price. You must use at least 1 array and you must display all numbers as dollar values (exactly 2 places after the decimal)   EXPECTED OUTPUT   Welcome to the Budget Helper. What are the last 5 things you bought?   Item 1 name: Bananas   Item 1 price: 1.5   Item 2 name: Shoes   Item 2 price: 45   Item 3 name: Coffee   Item 3 price: 2.5   Item 4 name: Metrocard   Item 4 price: 120   Item 5 name: Jacket   Item 5 price: 89 The total amount you spent is $258 The average price per item is $51.60 The cheapest item is Bananas The most expensive item is Jacket

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

 Write a C++ program that helps the user plan out their budget. It should ask the user for the most recent 5 things that they bought; it should ask for both the name for the item and its price. Then, print out the following: total money spent, average money spent per item, lowest priced item, and highest priced item. You can assume that each item has a different name and a different price. You must use at least 1 array and you must display all numbers as dollar values (exactly 2 places after the decimal)

  EXPECTED OUTPUT

  Welcome to the Budget Helper. What are the last 5 things you bought?
  Item 1 name: Bananas
  Item 1 price: 1.5
  Item 2 name: Shoes
  Item 2 price: 45
  Item 3 name: Coffee
  Item 3 price: 2.5
  Item 4 name: Metrocard
  Item 4 price: 120
  Item 5 name: Jacket
  Item 5 price: 89

The total amount you spent is $258
The average price per item is $51.60
The cheapest item is Bananas
The most expensive item is Jacket

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning