Question: I need help writing the pseudocode for the following python program: def getSum(item1, item2, item3, item4, item5): return item1 + item2 + item3 + item4
I need help writing the pseudocode for the following python program:
def getSum(item1, item2, item3, item4, item5): return item1 + item2 + item3 + item4 + item5 def getTotalTax(subtotal): return subTotal * .06 def getTotalAmount(subTotal, totalTax): return subTotal + totalTax def main(): # Enter price for Item1 item1 = float(input('Enter the price for item1: ')) # Enter price for Item2 item2 = float(input('Enter the price for item2: ')) # Enter price for Item3 item3 = float(input('Enter the price for item3: ')) # Enter price for Item4 item4 = float(input('Enter the price for item4: ')) # Enter price for Item5 item5 = float(input('Enter the price for item5: ')) print() # Calculate the total owed before tax subTotal = getSum(item1,item2,item3,item4,item5) print('The subtotal of the items is: ', subTotal) # Calculate the total tax amount owed totalTax = getTotalTax(subTotal) print('The total tax owed is: ', totalTax) # Calculate the total amount owed totalAmount = getTotalAmount(subTotal, totalTax) print('The total amount owed is: ', totalAmount) main()
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
