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
Alchen [17]
3 years ago
14

Write an application for Cody’s Car Care Shop that shows a user a list of available services: oil change, tire rotation, battery

check, or brake inspection. Allow the user to enter a string that corresponds to one of the options, and display the option and its price as $25, $22, $15, or $5, accordingly. Display Invalid Entry if the user enters an invalid item.
Computers and Technology
1 answer:
Firdavs [7]3 years ago
3 0

An application for Cody’s Car Care:

#include <iostream>

#include <string>

#include <vector>

using namespace std;

int main()

{

vector<string>stroptions(4);

stroptions[0] = "Oil Change";

stroptions[1] = "Tire Rotation";

stroptions[2] = "Battery Check";

stroptions[3] = "Brake Inspection";

 

vector<int> intprices(4);

intprices[0] = 45;

intprices[1] = 22;

intprices[2] = 15;

intprices[3] = 10;

 

int option;

cout<< "Welcome to Joe's Car Care Shop!" <<endl;

cout<< "Choose a service from our menu:" <<endl;

for(int i = 1; i<= 4; i++)

{

  cout<< "#" <<i<< ": " <<stroptions[i-1] <<endl;

}

cout<< "Choice: ";

bool loop = true;

while(loop)

{

  loop = false;

  cin>> option;

 switch(option)

  {

   case 1:

     cout<< "\nA " <<stroptions[option-1] << " will be: $" <<intprices[option -1] <<endl;

     break;

   case 2:  

     cout<< "\nA " <<stroptions[option -1] << " will be: $" <<intprices[option -1] <<endl;

     break;

   case 3:

     cout<< "\nA " <<stroptions[option -1] << " will be: $" <<intprices[option -1] <<endl;

     break;

   case 4:

     cout<< "\nA " <<stroptions[option -1] <<" will be: $" << intprices[option -1] <<endl;

      break;

    default:

     cout<< "\nYou entered an invalid item! Try again!" <<endl;

     loop = true;

     break;

 }

}

}

You might be interested in
Often duties and taxes are imposed on cars that are imported fron other countries. What type of incentives are these duties and
Kipish [7]

These duties and taxes are charged on imported cars in order to incentivize the people to purchase vehicles built in the home county instead.

6 0
3 years ago
Given that String[] str has been initialized, to get a copy of str[0] with all characters converted to upper case, use the follo
Strike441 [17]

Answer: str[0].toUpperCase();

Explanation:

str[0] is pointing to the first character of the entire string and the code str[0].toUpperCase() will convert the characters to upper case if they are in lowercase and will remain unchanged if they are already in upper case.

7 0
3 years ago
Write a C++ programthat reads in the side of a square and prints out a pattern on$
AnnZ [28]

Answer:

#include<iostream>

using namespace std;

//main function

int main(){

   //initialize the variables

   int side;

   //print the message

   cout<<"Please enter the side of square: ";

   cin>>side;  //read the vale and store in the variable.

   // for loop

   for(int i=1;i<=side;i++){  //lop for rows

       for(int j=1;j<=side;j++){   //loop for column

           cout<<"$";  //print the '*'

       }

       cout<<endl;

   }

}

Explanation:

Create the main function and declare the variable side.

print the message on the screen for the user and then store value enter by the user on the variable side.

take the nested for loop for print the pattern.

nested for loop means, loop inside another loop it is used for print the pattern having rows and columns.

the first loop updates the row number and the second the loop print the character '$' in the column-wise.

in the code,

if i = 1, for loop check the condition 1 <= 5 if the value of side is assume 5.

condition is true and the program moves to the second for loop and starts to print the character '$' five times after that, print the new line.

then, the above process repeat for different rows and finally, we get the pattern in square shape.

7 0
3 years ago
Write method reverseString, which takes a string str and returns a new string with the characters in str in reverse order. For e
son4ous [18]

Answer:

The method written in Java is as follows:

public static String reverseString(String str){

    String result = "";

    int lentt = str.length();

    char[] strArray = str.toCharArray();

       for (int i = lentt - 1; i >= 0; i--)

           result+=strArray[i];

    return result;

}

Explanation:

This defines the method

public static String reverseString(String str){

This initializes the result of the reversed string to an empty string

    String result = "";

This calculates the length of the string

    int lentt = str.length();

This converts the string to a char array

    char[] strArray = str.toCharArray();

This iterates through the char array

       for (int i = lentt - 1; i >= 0; i--)

This gets the reversed string

           result+=strArray[i];

This returns the reversed string            

    return result;

}

<em>See attachment for full program that includes the main method</em>

Download txt
3 0
3 years ago
You administer a Microsoft SQL Server environment. You purchase a new server and plan to migrate your database from SQL Server 2
Snezhnost [94]

Answer:

B. Migration Assistant

Explanation:

Migration assistant also referred to as the Data Migration Assistant (DMA) is a Microsoft tool used during SQL server upgrades to detect any compatibility issues that could impact the functionality of the new version of SQL server being installed. The Data Migration Assistant will also recommend performance and reliability improvements as well as allow you to move your SQL server data and schema from the source server to the destination server.

8 0
3 years ago
Other questions:
  • How does the browser display the same webpage whether you enter the URL or the IP address in the address bar? what system transl
    11·1 answer
  • Networks that are designed to connect similar computers that share data and software with each other are called:
    10·1 answer
  • Many 12-15 yrs hv access to the internet which cannot be supervised by an adult.i need 5 problems tht this might cause
    5·1 answer
  • In the maintenance phase of the waterfall model, the parts of a program are brought together into a smoothly functioning whole,
    11·1 answer
  • What is the major benefit Smartphones and tablet computers have had on social media?
    9·1 answer
  • Which option is the default when creating appointments and meetings in a user’s own calendar as it relates to Free/Busy informat
    8·1 answer
  • Which devices are used in networking
    15·1 answer
  • What can be done to solve unemployment problem?​
    11·1 answer
  • Which block in this module represents the variable?
    8·1 answer
  • For computer forensics, ____________ is the task of collecting digital evidence from electronic media.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!