Answered step by step
Verified Expert Solution
Question
1 Approved Answer
{ cells: [ { cell _ type: markdown, id : 7 2 a 5 ddfa, metadata: { id :
"cells":
"celltype": "markdown",
id: addfa",
"metadata":
id: addfa"
"source":
# Guided Practice Conditional Statements"
"celltype": "markdown",
"source":
### Try each of the Codes by pressing the Play button. You can modify the code and run again to see the outputs. Activities that need to be completed by the student are numbered.
### Answer the questions and download your completed activity with full outputs as a ipynb and a pdf file. Use the Print option in the web browser to download the pdf file. In your Chrome browser, press CTRLP and select Set the Destination to Save as PDF or Print to PDF or the apropriate selection based on your computer. Save the file and submit your pdf file and ipynb in Canvas. A video on this process can be viewed using this linkhttps:ecpihosted.panopto.comPanoptoPagesVieweraspx?idcbabddbabd or by running the code block below this. Thanks!"
"metadata":
id: AieqSoCPSvn"
id: AieqSoCPSvn"
"celltype": "code",
"source":
# Download Colab Notebook as pdf and ipynb Instructions
"from IPython.display import HTML
HTML
"metadata":
id: "dTJXQoArHCp
"executioncount": null,
"outputs":
id: "dTJXQoArHCp
"celltype": "markdown",
id: ecdb
"metadata":
id: ecdb
"source":
# Activity
## Modify the program below to demonstrate the following:
Calculate the total tax amount using a tax percentage of if the gross pay is greater than and if it is less than or equal to
Use the calculated tax amount in dollars to subtract from gross pay and display the net pay"
"celltype": "code",
"executioncount": null,
id: fcda",
"metadata":
id: fcda"
"outputs":
"source":
# Activity
#Variables to represent the base hours and
# the overtime multiplier.
"basehours # Base hours per week
otmultiplier # Overtime multiplier
# Get the hours worked and the hourly pay rate.
"hours floatinputEnter the number of hours worked:
"payrate floatinputEnter the hourly pay rate:
# Calculate and display the gross pay.
if hours basehours:
# Calculate the gross pay with overtime.
# First, get the number of overtime hours worked.
overtimehours hours basehours
# Calculate the amount of overtime pay.
overtimepay overtimehours payrate otmultiplier
# Calculate the gross pay.
grosspay basehours payrate overtimepay
"else:
# Calculate the gross pay without overtime.
grosspay hours payrate
# Display the gross pay.
"printThe gross pay is $ formatgrosspay, f sep
#Calculate tax
"celltype": "markdown",
id: cbae
"metadata":
id: cbae
"source":
# Activity
##Modify the program below to demonstrate the following:
Ask the user for their creditscore.
For the user to be qualified for the loan they must have:
Minimum credit score of
A minimum salary greater than minsalary line
A minimum credit age of minyears line
"celltype": "code",
"executioncount": null,
id: fcd
"metadata":
id: fcd
"outputs":
"source":
# Activity
#This program determines whether a bank customer
# qualifies for a loan.
"MINSALARY
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