Question
What is the Pseudocode, input and output for the following code? ''' import platform weeklySalary = 0.0 incomeBracket = { '500>salary': 0.10, '500 =2500': 0.30
What is the Pseudocode, input and output for the following code?
'''
import platform
weeklySalary = 0.0
incomeBracket = {
'500>salary': 0.10,
'500<=salary<1500': 0.15,
'1500<=salary<2500': 0.20,
'salary>=2500': 0.30
}
requestString = "Enter weekly salary: $"
while True:
rawWeeklySalary = input(requestString)
if rawWeeklySalary.isdigit():
weeklySalary = float(rawWeeklySalary)
break
else:
requestString = "Please enter proper Weekly Salary: $"
continue
tax = 0.0
taxRate = 0.0
if 0 taxRate = incomeBracket['500>salary'] tax = weeklySalary * taxRate elif 500<=weeklySalary<1500: taxRate = incomeBracket['500<=salary<1500'] tax = weeklySalary * taxRate elif 1500<=weeklySalary<2500: taxRate = incomeBracket['1500<=salary<2500'] tax = weeklySalary * taxRate else: taxRate = incomeBracket['salary>=2500'] tax = weeklySalary * taxRate print(' For weekly salary of $',round(weeklySalary,2),', taxpayer has to pay tax rate of ',round(taxRate,2),sep='',end='% ') print('Total tax paid is $', round(tax,2), sep='') print('Salary after tax is $', round(weeklySalary - tax,2), sep='')
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