Problem 1. Budgeted vs. Actual Expenses Write program that asks the user to enter the amount that he or she has budgeted for a month. Using a while loop, the user should be prompted to enter each of his or her expenses for the month and keep a running total. When the loop finishes, the program should display the amount that the user is over or under budget. Design. Use an IPO diagram to design your program. See IPO diagram attached to this assignment. Code. Write your program in Python using the above steps. Save your program as a .py file with the name yourlastname Lab4.1.py Output. Your ogram should produce correctly labeled output with dollar amounts rounded to 2 decimal places and dollar signs. Sample dialog: Enter amount budgeted for the month: 500 Enter an amount spent (0 to quit): 50 Enter an amount spent (0 to quit): 75 spent (0 to quit): 800 spent (0 to quit): 23.95 Enter an amount Enter an amount Enter an amour spent (0 to quit): 0 Budgeted: $ 500.00 Spent: $948.95 You are $ 448.95 over budget. PLAN BETTER NEXT TIME!

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 28PE
icon
Related questions
Question
Can you help me with my python code for this.
Problem 1. Budgeted vs. Actual Expenses
Write program that asks the user to enter the amount that he or she has budgeted for a month.
Using a while loop, the user should be prompted to enter each of his or her expenses for the
month and keep a running total. When the loop finishes, the program should display the amount
that the user is over or under budget.
Design. Use an IPO diagram to design your program. See IPO diagram attached to this assignment.
Code. Write your program in Python using the above steps. Save your program as a py file with the
name yourlastname lab4.1.py
Output. Your program should produce correctly labeled output with dollar amounts rounded to 2
decimal places and dollar signs. Sample dialog:
Enter amount budgeted for the month: 500
Enter an amount spent (0 to quit): 50
Enter an amount
spent (0 to quit): 75
Enter an amount
spent (0 to quit): 800
Enter an amount
spent (0 to quit): 23.95
Enter an amount spent (C to quit): 0
Budgeted: $ 500.00
Spent: $948.95
You are $448.95 over budget. PLAN BETTER NEXT TIME!
Problem 2. Ocean Levels
Assuming the ocean's level is currently rising at about 1.8 millimeters per year, create an application
that displays the number of millimeters that the ocean will have risen each year for the next 25
years, You must use a loop to create the data output.
Focus
6-17 PM
Y
100%
Transcribed Image Text:Problem 1. Budgeted vs. Actual Expenses Write program that asks the user to enter the amount that he or she has budgeted for a month. Using a while loop, the user should be prompted to enter each of his or her expenses for the month and keep a running total. When the loop finishes, the program should display the amount that the user is over or under budget. Design. Use an IPO diagram to design your program. See IPO diagram attached to this assignment. Code. Write your program in Python using the above steps. Save your program as a py file with the name yourlastname lab4.1.py Output. Your program should produce correctly labeled output with dollar amounts rounded to 2 decimal places and dollar signs. Sample dialog: Enter amount budgeted for the month: 500 Enter an amount spent (0 to quit): 50 Enter an amount spent (0 to quit): 75 Enter an amount spent (0 to quit): 800 Enter an amount spent (0 to quit): 23.95 Enter an amount spent (C to quit): 0 Budgeted: $ 500.00 Spent: $948.95 You are $448.95 over budget. PLAN BETTER NEXT TIME! Problem 2. Ocean Levels Assuming the ocean's level is currently rising at about 1.8 millimeters per year, create an application that displays the number of millimeters that the ocean will have risen each year for the next 25 years, You must use a loop to create the data output. Focus 6-17 PM Y 100%
Year
1
2
3
1
4
C
5
10
7
2
8
10
2322987222
12
16
17
18
20
24
Rise (in millimeters)
1.80
3.60
5.40
7.20
19.00
10.80
12.60
14.40
16.20
Found
18.00
19.80
21.60
23.40
25.20
27.00
28.80
30.60
32 40
34.20
36.00
37.80
39.60
41.40
43.20
45.00
Programming Style Requirements.
Comments - Both inline comments and header are required, as usual.
Variable names - use meaningful variable names such as total taxes or num cookies.
Named constants - Use named constants for all number values that will not be changed in the
program such as RECIPE SUGAR = 1.5. See section 2.9 on Named Constants
Ben Fra
EF
Transcribed Image Text:Year 1 2 3 1 4 C 5 10 7 2 8 10 2322987222 12 16 17 18 20 24 Rise (in millimeters) 1.80 3.60 5.40 7.20 19.00 10.80 12.60 14.40 16.20 Found 18.00 19.80 21.60 23.40 25.20 27.00 28.80 30.60 32 40 34.20 36.00 37.80 39.60 41.40 43.20 45.00 Programming Style Requirements. Comments - Both inline comments and header are required, as usual. Variable names - use meaningful variable names such as total taxes or num cookies. Named constants - Use named constants for all number values that will not be changed in the program such as RECIPE SUGAR = 1.5. See section 2.9 on Named Constants Ben Fra EF
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Types of Loop
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
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,