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
UkoKoshka [18]
3 years ago
9

Prompt the user for an automobile service. Each service type is composed of two strings. Output the user's input. (1 pt) Ex: Ent

er 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: Oil change -- $35 Tire rotation -- $19 Car wash -- $7 If the user enters a service that is not listed above, then output the following error message: Error: Requested service is not recognized
Computers and Technology
1 answer:
Svet_ta [14]3 years ago
8 0

Answer:

Required code is given below.

Best Regards,

Please ask if any queries.

Explanation:

#include <stdio.h>

#include <string.h>

int main(void)

{

  char input[100];

  printf("Enter desired auto service:\n");

  scanf ("%[^\n]%*c", input);

  printf("You entered: %s\n",input);

  if(strcmp(input,"Oil change") == 0){

     printf("Cost of oil change: $35\n");

  }

  else if(strcmp(input,"Tire rotation") == 0){

     printf("Cost of tire rotation: $19\n");

  }

  else if(strcmp(input,"Car wash") == 0){

     printf("Cost of car wash: $7\n");

  }

  else{

      printf("Error: Requested service is not recognized\n");

  }

   

  return 0;

}

You might be interested in
Which of the following color palettes for the BackColor and ForeColor properties contains colors that are guaranteed to be displ
Norma-Jean [14]

Answer: 1)System Palette

Explanation: System palette is kind of palette found in the system which contain the color values that is used by the display.This palette is also  drawing of the devices and applications.But the application don't get the direct access to the system palette rather logical palette permits it.

They work on the basis of the properties carried from the Back color and Fore color.Other palettes mention in the option is incorrect because these palettes don't work for the operating system's display .Thus the correct option is option(1).

8 0
4 years ago
Traceroute would be best suited for which of the following tasks?
sleet_krkn [62]
The answer is A, or Locating bottlenecks in a network.
3 0
2 years ago
Referring to the BST and BSTNode classes for binary search trees as done in class: Determine the result of executing root. whate
Rzqust [24]

Answer:

Try to add allthe numbers up

Explanation:

3 0
4 years ago
Advantages of a compiler​
valentina_108 [34]

Answer:

Improved performance.

Reduced system load.

Protection for source code and programs.

Improved productivity and quality.

Portability of compiled programs.

SAA compliance checking.

3 0
3 years ago
Read 2 more answers
What did you predict will happen? Check all that apply. The lioness will attack Thisbe. Thisbe will stay hidden in the cave to a
sesenic [268]

Hi,


Everything applies. It is impossible to predict based on the current data. All scenarios are possible with equal possibility.


Hope this helps.

r3t40

5 0
3 years ago
Read 2 more answers
Other questions:
  • How to use translate on a website?
    15·1 answer
  • All queries have an explicit location. true of false
    13·2 answers
  • 4
    5·1 answer
  • What service converts ip addresses into more recognizable alphanumeric names??
    8·1 answer
  • You are requesting information about wireless connectivity for your workplace computers. Because you expect the information to b
    15·1 answer
  • A=3<br> b = 2<br> print (a ** b)<br> What is output?
    13·2 answers
  • If your pulse is higher than your Target Heart Rate during exercise, what should you do?
    5·2 answers
  • In order to preview an attachment in an e-mail, click the attachment in the ______
    8·1 answer
  • Refer to the image on the right. Then, using the drop-down menu, identify the correct printer type. A: inexpensive home printer
    10·1 answer
  • In the tcp/ip protocol that allows communication across the internet, what does tcp do?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!