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
Can someone please give me Python test 3 it would help me tremendously
Ket [755]

Question 1:  To tell what will happen when an if-statement is false.

Question 2: The = should be ==

                    elseif should be elif

                    The else should have a :

Question 3: All algorithms can only do number calculations.  

Question 4: and

Question 5: To make a follow-up True/ False decision

Question 6: if (text1 > 15):

Question 7: if (text1 == 78):

Question 8: if (num1 != num2):

Question 9: >=

Question 10: 4

Question 11: 3

Question 18: a < b and a != b  

Question 19: !=

Sorry about 12 - 17 and 20 i can't seem to find those questions guessing you wanted edhesive. I dont have an account on it.

5 0
3 years ago
Write code statements to create a DecimalFormat object that will round a formatted value to four decimal places. Then write a st
KonstantinChe [14]

Answer:

Following is the code in Java Language :

DecimalFormat form1= new DecimalFormat ("0.####");  // create an instance of                                                                                            .                                                                                            //DecimalFormat

System.out.println (form1.format(res)); // display the value in proper format

Explanation:

Following are the description of the program

  • Firstly we create the instance of DecimalFormat i.e  "form1"  that will round a formatted value to four decimal places. To create an instance or object of the class we can use a new keyword.
  • Finally, we print the format by using the format method.In the format method, we pass the variable "res".The System.out.println() is used to display the value of the format.
3 0
3 years ago
A student that earns a well qualified score on an ap exam would receive a ___
elena55 [62]

Ap exams are scored on a scale of 1 to 5. A score of 5 means that the student is extremely well qualified to receive college credit for that course. But the answer to this would be 4. When someone gets a 4 it means they are well qualified.

Answer: 4

3 0
3 years ago
in cell h5, enter a formula that will calculate the percentage of attendees that went to the Altamonte springs job fair in 2018.
xz_007 [3.2K]
Formula is 

 = (a/b)(100)
8 0
3 years ago
Read 2 more answers
Sheila is using a process of saving files to her desktop and then renaming them. She is
inessss [21]

Answer: D

Use the internet to search for a new app to rename the folder.​

Explanation:

Rename function is used to change the name of the file or directory i.e. from old_name to new_name without changing the content present in the file. This function takes name of the file as its argument. There are many alternatives to this in which Sheila can found out through the internet.

5 0
3 years ago
Read 2 more answers
Other questions:
  • To find a webpage, the user of a search engine would simply enter a word or phrase in the resource's text box. what is the term
    11·1 answer
  • What were precomputed tables and why were they necessary?​
    12·2 answers
  • In scratch the location of a sprite is defined by what?
    10·1 answer
  • Why is the stateless nature of the internet a problem for shopping cart software? g?
    5·2 answers
  • Which element in the PowerPoint application is not available in the Microsoft Word application?
    12·2 answers
  • Create a program that asks the user to enter grade scores. Use a loop to request each score and add it to a total. Continue acce
    9·1 answer
  • Write a Java application that uses the Math class to determine the answers for each of the following: a. The square root of 37 b
    10·1 answer
  • Question 2
    7·1 answer
  • A network administrator wants to authenticate server machines using Transport Layer Security (TLS). What can the administrator i
    15·1 answer
  • A user may enter some text and the number of times (up to a maximum of 10) to repeat it. Display the text repeated that many tim
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!