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!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education