# Selling a new vehicle pays a salesperson \$1500. Selling a used vehicle pays a commission of 5% of the selling price. Write an interactive program that calculates a salesperson's total pay for selling two vehicles, each one of any type. The program should prompt the salesperson to enter the type and selling price of each vehicle. Do not use a loop. The program should then display the salesperson's total sales and total pay. Express these amounts in currency format as described in the requirements above.

Question
12 views

Selling a new vehicle pays a salesperson \$1500. Selling a used vehicle pays a commission of 5% of the selling price. Write an interactive program that calculates a salesperson's total pay for selling two vehicles, each one of any type. The program should prompt the salesperson to enter the type and selling price of each vehicle. Do not use a loop. The program should then display the salesperson's total sales and total pay. Express these amounts in currency format as described in the requirements above.

check_circle

Step 1

To perform this without loop.

• This program used repeatative input asked by user.
• Caclulation also used repeatative .
Step 2

Program:

#taking input from user

type=input("Enter the type of vehicle.\nType \"new\" for new vehicle and \"old\" for old vehicle: ")

#taking input from user

sellPrice=float(input("enter the selling price of vehicle: "))

pays=0

count=0

#if statement

if(type=="new"):

count=count+1

pays=pays+1500

#elif statement

elif(type=="old"):

count=count+1

pays=pays+(sellPrice*0.05)

type=input("Enter the type of vehicle.\nType \"new\" for new vehicle and \"old\" for old vehicle: ")

#taking input...

### Want to see the full answer?

See Solution

#### Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in