Write a python program and solve the problem.Selling a new vehicle pays a salesperson $1800. Selling a used vehicle pays a commission of 10% of the selling price. Write an interactive program that calculates a salesperson's total pay for selling two vehicles, one of each 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
Asked Nov 11, 2019
148 views

Write a python program and solve the problem.

Selling a new vehicle pays a salesperson $1800. Selling a used vehicle pays a commission of 10% of the selling price. Write an interactive program that calculates a salesperson's total pay for selling two vehicles, one of each 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

Expert Answer

Step 1

Program Instructions:

  • Prompt the user to enter type and selling price of 2 vehicles. One must be old and the other one must be new.
  • Calculate the total pay based on 10% commission and total pay with mentioned selling price.
  • Print the total pay and total sales.
Step 2

Program:

# variable declarations

total_pay = 0.0

total_sale = 0.0

# prompt for user

type1 = input("Enter the type of car sold (N/U): ")

price1= float(input("Enter the selling price of the car: "))

type2 = input("Enter the type of car sold (N/U): ")

price2= float(input("Enter the selling price of the car: "))

# calculating total pay

if(type1.upper()=='U'):

    to...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

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

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: Write a program with python using random module for a (very) rudimentary shooter "game". You are the...

A: Program Algorithm-START-Step1: Import the essential modulesStep2: Define the shoot function.Step3: U...

question_answer

Q: in python  Given a nested list named table, use nested loops to print each element in the nested lis...

A: Create a PYTHON program to print all “table” (list) element with respect to there first, second and ...

question_answer

Q: Implement the following two methods in javascript:   String multiply2(String num) - return num*2 wit...

A: Program Instructions:In the function multiply2(), take one digit at a time, multiply it by two, and ...

question_answer

Q: An administrator has received a call indicating that some users are having difficulty logging on aft...

A: Domain Controller:Domain controller is a server computer on Microsoft servers.The purpose of domain ...

question_answer

Q: How would you modify the dynamic programming algorithm for the coin collecting problem if some cells...

A: Coin collecting problemIn a n-m board, several coins are placed in such a way no more than one coin ...

question_answer

Q: Find the truth table that describes the following circuit:

A: The gates involved in the given circuits are:AND gate between Y and X.XNOR gate between Y and ~Z whi...

question_answer

Q: EXPLAIN ALL STEPS: Determine the output of the following Pep/9 machine language program if the input...

A: Address   Instruction(in hex)0000         D1FC15Convert the instructions into binary form-D=11011=00...

question_answer

Q: Suppose that a maximum flow network contains a node, other than the source node, without incoming ar...

A: Maximum flow problem:“Yes”, it is possible if the maximum flow network does not contain source node ...

question_answer

Q: Create a project called Mileage. In it, create a class Car with the following properties. A car has ...

A: To Create a project called Mileage. In it, create a class Car with the following properties. A car h...