Question: Chapter 4 Loops Problem 1 . Budgeted vs . Actual Expenses Write program that asks the user to enter the amount that he or she
Chapter Loops
Problem 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 yourlastnameLabpy
Output. Your program should produce correctly labeled output with dollar amounts rounded to decimal places and dollar signs. Sample dialog:
Enter amount budgeted for the month:
Enter an amount spent to quit:
Enter an amount spent to quit:
Enter an amount spent to quit:
Enter an amount spent to quit:
Enter an amount spent to quit:
Budgeted: $
Spent: $
You are $ over budget. PLAN BETTER NEXT TIME!
Problem Ocean Levels
Assuming the oceans level is currently rising at about millimeters per year, create an application that displays the number of millimeters that the ocean will have risen each year for the next years.
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 yourlastnameLabpy
Output. Your program output should look something like this:
Year Rise in millimeters
Programming Style Requirements.
Comments Begin your program with a comment that includes: a your name, bprogram status either Complete or describe any incomplete or nonfunctioning part of your program cA line description of what the program does.
Variable names use meaningful variable names such as totaltaxes or numcookies.
Named constants Use named constants for all number values that will not be changed in the program such as RECIPESUGAR See section on Named Constants
You will have two py files and one IPO file to turn in to Blackboard.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
