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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!