(1) Prompt the user for an automobile service. Output the user's input. (1 pt) Ex: Enter desired auto service: Oil change You entered: Oil change (2) Output the price of the requested service. (4 pts) Ex: Enter desired auto service: Oil change You entered: Oil change Cost of oil change: $35 The program should support the following services (all integers): Oil change -- $35 Tire rotation -- $19 Car wash -- $7 If the user enters a service that is not l

Answers

Answer 1

Answer:

In Python:

#1

service = input("Enter desired auto service: ")

print("You entered: "+service)

#2

if service.lower() == "oil change":

   print("Cost of oil change: $35")

elif service.lower() == "car wash":

   print("Cost of car wash: $7")

elif service.lower() == "tire rotation":

   print("Cost of tire rotation: $19")

else:

   print("Invalid Service")

Explanation:

First, we prompt the user for the auto service

service = input("Enter desired auto service: ")

Next, we print the service entered

print("You entered: "+service)

Next, we check if the service entered is available (irrespective of the sentence case used for input). If yes, the cost of the service is printed.

This is achieved using the following if conditions

For Oil Change

if service.lower() == "oil change":

   print("Cost of oil change: $35")

For Car wash

elif service.lower() == "car wash":

   print("Cost of car wash: $7")

For Tire rotation

elif service.lower() == "tire rotation":

   print("Cost of tire rotation: $19")

Any service different from the above three, is invalid

else:

   print("Invalid Service")


Related Questions

Approximately how many numeric IP addresses are possible with IPv4?

4 billon

Answers

Answer:

4,294,967,296 (~4.3B)

Explanation:

IPv4 uses 32-bits for representing addresses, thus you can have 2^32 total combinations.

let m be a positive integer with n bit binary representation an-1 an-2 ... a1a0 with an-1=1 what are the smallest and largest values that m could have

Answers

Answer:

Explanation:

From the given information:

[tex]a_{n-1} , a_{n-2}...a_o[/tex] in binary is:

[tex]a_{n-1}\times 2^{n-1} + a_{n-2}}\times 2^{n-2}+ ...+a_o[/tex]

So, the largest number posses all [tex]a_{n-1} , a_{n-2}...a_o[/tex]  nonzero, however, the smallest number has [tex]a_{n-2} , a_{n-3}...a_o[/tex] all zero.

The largest = 11111. . .1 in n times and the smallest = 1000. . .0 in n -1 times

i.e.

[tex](11111111...1)_2 = ( 1 \times 2^{n-1} + 1\times 2^{n-2} + ... + 1 )_{10}[/tex]

[tex]= \dfrac{1(2^n-1)}{2-1}[/tex]

[tex]\mathbf{=2^n -1}[/tex]

[tex](1000...0)_2 = (1 \times 2^{n-1} + 0 \times 2^{n-2} + 0 \times 2^{n-3} + ... + 0)_{10}[/tex]

[tex]\mathbf {= 2 ^{n-1}}[/tex]

Hence, the smallest value is [tex]\mathbf{2^{n-1}}[/tex] and the largest value is [tex]\mathbf{2^{n}-1}[/tex]

A structure that organizes data in a list that is commonly 1-dimensional or 2-
dimensional
Linear Section
Constant
No answertet provided
It intro technology

Answers

Answer:

An array.

Explanation:

An array can be defined as a structure that organizes data in a list that is commonly 1-dimensional or 2-dimensional.

Simply stated, an array refers to a set of memory locations (data structure) that comprises of a group of elements with each memory location sharing the same name. Therefore, the elements contained in array are all of the same data type e.g strings or integers.

Basically, in computer programming, arrays are typically used by software developers to organize data, in order to search or sort them.

Binary search is an efficient algorithm used to find an item from a sorted list of items by using the run-time complexity of Ο(log n), where n is total number of elements. Binary search applies the principles of divide and conquer.

In order to do a binary search on an array, the array must first be sorted in an ascending order.

Hence, array elements are mainly stored in contiguous memory locations on computer.

Other Questions
The distance from Salvadors job to his house is three times greater than the distance from his house to the school. If his house is between his job and the school and the distance from his job to the school is 6 miles, how far is it from Salvadors house to the school?SHOW YOUR WORK pls and ty Study the table about Earths interior. A 4 column table with 5 rows. First column is unlabeled with entries: Crust, uppercase mantle, Lower mantle, Outer core, Inner core. Second column is labeled Thickness in kilometers with entries: 30, 720, 2,171, 2,259, 1,221. Third column is labeled Density in grams per centimeters cubed, divided into Top and Bottom columns. Top entries are: 2.2, 3.4, 4.4, 9.9, 12.8. Bottom entries are: 2.9, 4.4, 5.6, 12.2, 13.1. Fourth column is labeled Types of Rock Found with entries: Silicic rocks, Peridotite, Magnesium and silicon oxides, Iron plus oxygen, Iron plus oxygen. If silicic rock is found in a core sample, what evidence does this provide about the rocks location? Margo participated in a surfing competition. During the competition, the height of the ocean waves increased from two feet to six feet. a. Identify how many times greater the amount of energy carried by the six-foot wave was than the amount of energy caried by the two-foot wave. Explain your reasoning. Can you please answer this in the next 30 minutes? Completa la oracin con la opcin correcta.Las calles del Viejo San Juan estn Iluminadas ___1.)con yuca y mofongo2.)con lagunas flourescentes3.)con faroles de gas al estilo colonial4.)con ranas del tamao de una ua Which of the following is not a natural border for ChinaMountainsDesertsRiversOceans For AP World History B According to the author, what are the main differences between a HERO and a CELEBRITY? Why is it important for young people to have heroes in their lives? Explain. Two students are perfectly balanced on a motionless seesaw.Which of the following ismost likely true about the students?A They have different weights and are equal distances from the pivot of the seesaw.BThey have the same weights and are equal distances from the pivot of the seesaw.They have different heights and are different distances from the pivot of the seesaw.DThey have the same heights and are different distances from the pivot of the seesaw. How did the growth of Silk Road trade during the Renaissance influence people in Europe?O They spent less money on art.O They conducted less business.O They learned new printing methods.O They started speaking the same language. What is the value of x in the equation 1/5x - 2/3y = 30, when y = 15? What were the American ideals? Which of the following best describes one contribution of the Tuskegee Airmen during World War Il?O They flew missions over the USO They created a secret military code system,O They flew combat missions over Germany.O They helped develop the atomic bomb.Save and ExitSubmitMark this and return Whats the answer? One disadvantage to experimental research is that experimental conditions do not always reflect reality.Please select the best answer from the choices providedTF The cell phone price was originally $457. It is now being sold for $318. State the change to the nearest percentI really need help pls help 60 POINTS ASAP Which are equations? Check all that apply. Which of the following statement is true?a.Energy lost is destroyedb.Energy lost transforms to heat energyc.Energy is never wastedd.Energy unused is recycled in the atmosphere. When Ralph observes his own filth and the filth of the other boys, what is he generally aware of? Drag and drop each person to the correct description. Some choices may be used more than once.Corneliuis VanderbiltAndrew CarnegieJ.P. MorganA started a very successfulfinancial investmentcompany.B was a leader within thesteel industry.C helped expand and improvethe railroad.