Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem I: Ocean Levels Goal: Assuming the ocean s level is currently rising at about 1 . 2 millimeters per year, create a program that
Problem I: Ocean Levels
Goal: Assuming the oceans level is currently rising at about millimeters per year, create a program that
displays the number of millimeters that the ocean will have risen each year for the next years.
Design: You will be using an IPO diagram to design your program. Under INPUTS, list
everything the program will need to produce the result. Under OUTPUTS, list what the program is going to
produce. Under PROCESSING, list the detailed pseudocode steps needed to produce the programs output.
This includes formulas your program will need.
Output: Your program output should look something like this the values listed in the Rise column below
may not be real:
Year Rise in millimeters
Requirements:
Use named constants for all number values that will not be changed in the program
Use Fstrings
Problem II: Budgeted vs Actual Expenses
Goal: 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. The loop should finish when the user enters When the loop finishes, the program should display the amount that the user is over budget if any
Design: You will be using an IPO diagram to design your program. Under INPUTS, list
everything the program will need to produce the result. Under OUTPUTS, list what the program is going to
produce. Under PROCESSING, list the detailed pseudocode steps needed to produce the programs output.
Input Validation: The amount budgeted for a month must be a positive number; use a while loop to validate the input see example in section An expense must be a nonnegative number; use a while loop to validate the input. All decimal values must be rounded to two decimal places.
Output and Sample Dialog:
Enter amount budgeted for the month:
Enter a positive amount:
Enter a positive amount:
Enter a positive amount:
Enter an amount spent to quit:
Enter a nonnegative amount spent:
Enter a nonnegative amount spent:
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!
Your program should use Fstrings to produce correctly labeled output with dollar amounts rounded to two decimal places and dollar signs.
Requirements:
Use named constants for all number values that will not be changed in the program
Use Fstrings
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started