Programming C Create a program that tells you how much money you have left after buying furniture for your home. In main, ask for the initial amount of money. Then, send this value to function home. In function home, ask the user repeatedly for the expenses. Keep asking until the user inputs zero. When done, also in function home, print out the result (the money that the user has left). Output: How much money do you have? 20000.00 List the prices of the thing you just bought: 355.54 45.54 109.45 32.55 839.32 599.99 The money you have left: 18017.61

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question
Programming C
Create a program that tells you how much money you have left after buying furniture for your home.
In main, ask for the initial amount of money.
Then, send this value to function home. In function home, ask the user repeatedly for the expenses.
Keep asking until the user inputs zero.
When done, also in function home, print out the result (the money that the user has left).
Output:
How much money do you have?
20000.00
List the prices of the thing you just bought:
355.54
45.54
109.45
32.55
839.32
599.99
The money you have left: 18017.61
Transcribed Image Text:Programming C Create a program that tells you how much money you have left after buying furniture for your home. In main, ask for the initial amount of money. Then, send this value to function home. In function home, ask the user repeatedly for the expenses. Keep asking until the user inputs zero. When done, also in function home, print out the result (the money that the user has left). Output: How much money do you have? 20000.00 List the prices of the thing you just bought: 355.54 45.54 109.45 32.55 839.32 599.99 The money you have left: 18017.61
Expert Solution
Step 1

C program to show how much money you have left after buying furniture for your home.

Create a variable to store the initial Amount.

 prompt the user to enter the initial Amount. Store the initial amount in the variable.

Call the function named home with the initial Amount.

In the function,

Create a variable to store the expenses.

prompt the user to enter the expenses.

Using the while loop gets the expense amount from the user until the user enters 0.

Store the expenses in the variable.

Subtract the expenses from the initial amount.

 

Display the money left after the expenses.

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning