1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
QveST [7]
3 years ago
9

Selling a new vehicle pays a salesperson $1500. Selling a used vehicle pays a commission of 5% of the selling price. Write an in

teractive 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.
Engineering
1 answer:
Dahasolnce [82]3 years ago
4 0

Answer:

#Selling vehicles

import locale

locale.setlocale( locale.LC_ALL, 'en_CA.UTF-8' )

#Declaration of variables

total_pay=0

total_sales=0

#Selling details

for i in range(0,2):

   #Ask the type of sell

   type=input("Enter the type of the car you sold(used/new)? ")

   #Check error

   while(type.upper()!="USED" and type.upper()!="NEW"):

       print('ERROR!!!Should be used or new!!Please Re-enter')

       type=input("Enter the type of the car you sold(used/new)? ")

   #Input price of the car

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

   #Calculations

   if(type.upper()=="NEW"):

       total_pay+=1500

   else:

       total_pay+=price*.05

   total_sales+=price

#Display results

print('Total Pay of the sale person = ',locale.currency(total_pay))

print('Total Sales = ',locale.currency(total_sales))

You might be interested in
Component(s) that only allow(s) electrons to flow in one direction. Mark all that apply
Korolek [52]

Answer:

A,D, and E

Explanation:

6 0
3 years ago
We would like to measure the density (p) of an ideal gas. We know the ideal gas law provides p= , where P represents pressure, R
Nostrana [21]

Answer: =

Explanation:

=    P / (R * T) P- Pressure, R=287.058, T- temperature

From the given that

Sample mean(pressure) = 120300 Pa

Standard deviation (pressure) = 6600 Pa

Sample mean(temperature) = 340K

Standard deviation(temperature) = 8K

To calculate the Density;

Maximum pressure = Sample mean(pressure) + standard deviation (pressure) = 120300+6600 = 126900 Pa

Minimum pressure = Sample mean (pressure) - standard deviation (pressure)= 120300-6600 = 113700 Pa

Maximum temperature = Sample mean (temperature) + standard deviation (temperature) = 340+8 = 348K

Minimum temperature = Sample mean (temperature) - standerd deviation (temperature) = 340-8 = 332K

So now to calculate the density:

Maximum Density= Pressure (max)/(R*Temperature (min))= 126900/(287.058*332)= 1.331

Minimum density=Pressure(min)/(R*Temperature (max))= 113700/(287.058*348)= 1.138

Average density= (density (max)+ density (min))/2= (1.331+1.138)/2= 1.2345

cheers i hope this helps

5 0
3 years ago
PythonA group of statisticians at a local college has asked you to create a set of functionsthat compute the median and mode of
skelet666 [1.2K]

Answer:

  1. def median(l):
  2.    if(len(l) == 0):
  3.       return 0
  4.    else:
  5.        l.sort()
  6.        if(len(l)%2 == 0):
  7.            index = int(len(l)/2)
  8.            mid = (l[index-1] + l[index]) / 2
  9.        else:
  10.            mid = l[len(l)//2]  
  11.        return mid  
  12. def mode(l):
  13.    if(len(l)==0):
  14.        return 0
  15.    mode = max(set(l), key=l.count)
  16.    return mode  
  17. def mean(l):
  18.    if(len(l)==0):
  19.        return 0
  20.    sum = 0
  21.    for x in l:
  22.        sum += x
  23.    mean = sum / len(l)
  24.    return mean
  25. lst = [5, 7, 10, 11, 12, 12, 13, 15, 25, 30, 45, 61]
  26. print(mean(lst))
  27. print(median(lst))
  28. print(mode(lst))

Explanation:

Firstly, we create a median function (Line 1). This function will check if the the length of list is zero and also if it is an even number. If the length is zero (empty list), it return zero (Line 2-3). If it is an even number, it will calculate the median by summing up two middle index values and divide them by two (Line 6-8). Or if the length is an odd, it will simply take the middle index value and return it as output (Line 9-10).

In mode function, after checking the length of list, we use the max function to estimate the maximum count of the item in list (Line 17) and use it as mode.

In mean function,  after checking the length of list,  we create a sum variable and then use a loop to add the item of list to sum (Line 23-25). After the loop, divide sum by the length of list to get the mean (Line 26).

In the main program, we test the three functions using a sample list and we shall get

20.5

12.5

12

3 0
3 years ago
What are the controlling LRFD load combinations for dead and floor live load?
yuradex [85]

Answer:

1) 1.4(D + F)

2) 1.2(D + F + T) + 1.6(L + H) + 0.5(Lr or S or R)

3) 1.2D + 1.6(Lr or S or R) + ((0.5 or 1.0)*L or 0.8W)

4) 1.2D + 1.6W + (0.5 or 1.0)*L + 0.5(Lr or S or R)

5) 1.2D + 1.0E + (0.5 or 1.0)*L + 0.2S

6) 0.9D + 1.6W + 1.6H

7) 0.9D + 1.0E + 1.6H

Explanation:

Load and Resistance Factor Design

there are 7 basic load combination of LRFD that is

1) 1.4(D + F)

2) 1.2(D + F + T) + 1.6(L + H) + 0.5(Lr or S or R)

3) 1.2D + 1.6(Lr or S or R) + ((0.5 or 1.0)*L or 0.8W)

4) 1.2D + 1.6W + (0.5 or 1.0)*L + 0.5(Lr or S or R)

5) 1.2D + 1.0E + (0.5 or 1.0)*L + 0.2S

6) 0.9D + 1.6W + 1.6H

7) 0.9D + 1.0E + 1.6H

and

here load factor for L given ( * ) mean it is  permitted = 0.5 for occupancies when live load is less than or equal to 100 psf

here

D is dead load and L is live load

E is earth quake load and S is snow load

W is wind load and R is rain load

Lr is roof live load

3 0
3 years ago
An 800-kg drag racer accelerates from rest to 390 km/hr in 5.8 s. What is the net impulse applied to the racer in the first 5.8
marissa [1.9K]

Answer:

Impulse =14937.9 N

tangential force =14937.9 N

Explanation:

Given that

Mass of car m= 800 kg

initial velocity u=0

Final velocity v=390 km/hr

Final velocity v=108.3 m/s

So change in linear momentum P= m x v

           P= 800 x 108.3

 P=86640 kg.m/s

We know that impulse force F= P/t

So F= 86640/5.8 N

F=14937.9 N

Impulse force F= 14937.9 N

We know that

v=u + at

108.3 = 0 + a x 5.8

a=18.66\ m/s^2

So tangential force F= m x a

F=18.66 x 800

F=14937.9 N

6 0
3 years ago
Other questions:
  • The function of a circuit breaker is to _____.
    12·1 answer
  • What must engineers keep in mind so that their solutions will be appropriate? O abstract knowledge O context O scientists persev
    12·1 answer
  • I dont undertand this coding problem (Java):
    8·1 answer
  • A closed, rigid, 0.45 m^3 tank is filled with 12 kg of water. The initial pressure is p1 = 20 bar. The water is cooled until the
    15·1 answer
  • The rigid beam is supported by a pin at C and an A992 steel guy wire AB of length 6 ft. If the wire has a diameter of 0.2 in., d
    14·1 answer
  • Ohm's law states that the current (I) in amps equals the voltage (E) in volts decided by the resistance (R) in ohm's. If you con
    15·1 answer
  • On diesel engines, data from ________ sensors are commonly used to adjust exhaust gas recirculation (EGR) rates.
    11·1 answer
  • What lump sum of money must be deposited in a bank account at present time so that Php 500 monthly can be withdrawn for five yea
    10·1 answer
  • the left rear brake drum is scored, but the right rear drum looks as good as new. technician a says the left-side drum should be
    10·1 answer
  • Which of the given strategies is specifically a competitive advantage sustainment strategy?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!