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]
2 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]2 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
What type of software is developed by volunteers, contains code in the public domain, and helped to make Linux popular
valentina_108 [34]
Perhaps I’m being 5tup1d but I think your describing open source soft in general. Linux and a lot of periphery that runs on Linux is open source so it did play a large role being that it’s not proprietary like Windows and windows adjacent soft.
5 0
2 years ago
Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, s
Afina-wow [57]

The code is implemented based on the given operations.

Explanation:

#include <iostream>

#include <string>

using namespace std;

class dayType

{ private:

 string day[7];

 string presentDay;

 int numofDays;

public:

 void setDay(string freshDay);

 void printDay() const;

 int showDay(int &day);

 int nextDay(int day);

 int prevDay(int day) const;

 int calcDay(int day, int numofDays);    

 dayType()

 {

  day[0] = "Sunday";

  day[1] = "Monday";

  day[2] = "Tuesday";

  day[3] = "Wednesday";

  day[4] = "Thursday";

  day[5] = "Friday";

  day[6] = "Saturday";

  presentDay = day[0];

  numofDays = 0;

 };

 ~dayType();

};

#endif

#include "dayType.h"

void dayType::setDay(string freshDay)

{

  presentDay = freshDay;

}

void dayType::printDay()

{

  cout << "Day chosen is " << presentDay << endl;

}

int dayType::showDay(int& day)

{

  return day;

}

int dayType::nextDay(int day)

{

day = day++;

if (day > 6)

 day = day % 7;

switch (day)

{

case 0: cout << "The successive day is Sunday";

 break;

case 1: cout << "The successive day is Monday";

 break;

case 2: cout << "The successive day is Tuesday";

 break;

case 3: cout << "The successive day is Wednesday";

 break;

case 4: cout << "The successive day is Thursday";

 break;

case 5: cout << "The successive day is Friday";

 break;

case 6: cout << "The successive day is Saturday";

 break;

}

cout << endl;

return day;

}

 

int dayType::prevDay(int day)

{

day = day--;

switch (day)

{

case -1: cout << "The before day is Saturday.";

 break;

case 0: cout << "The before day is Saturday.";

 break;

case 1: cout << "The before day is Saturday.";

 break;

case 2: cout << "The before day is Saturday.";

 break;

case 3: cout << "The before day is Saturday.";

 break;

case 4: cout << "The before day is Saturday.";

 break;

case 5: cout << "The before day is Saturday.";

 break;

default: cout << "The before day is Saturday.";

}

cout << endl;

return day;

}

int dayType::calcDay(int addDays, int numofDays)

{

addDay = addDays + numofDays;

if (addDay > 6)

 addDay = addDay % 7;

switch(addDay)

{

case 0: cout << "The processed day is Sunday.";

 break;

case 1: cout << "The processedday is Monday.";

 break;

case 2: cout << "The processedday is Tuesday.";

 break;

case 3: cout << "The processedday is Wednesday.";

 break;

case 4: cout << "The processedday is Thursday.";

 break;

case 5: cout << "The processedday is Friday.";

 break;

case 6: cout << "The processedday is Saturday.";

 break;

default: cout << "Not valid choice.";

}

cout << endl;

return addDays;

}

4 0
2 years ago
Files exist on ____ storage devices, such as hard disks, dvds, usb drives, and reels of magnetic tape.
Verdich [7]
<span>Files exist on data storage devices, such as hard disks, DVDs, USB drives, and reels of magnetic tape.
</span>Data storage<span> is the recording (storing) of information (data) and </span><span>these data storage devices use</span> a technology consisting of computer components and recording media used to retain digital data.DVDs, USBs and hard disks are examples for external data storage devices.
8 0
3 years ago
maximum cardinality indicates whether or not an instance of one entity class must be related to at least one instance of another
vladimir1956 [14]

This is false.

What is cardinality?

Cardinality refers to the entity instances for which it is eligible to participate in a relationship instance. There are two types of cardinality, maximum and minimum.

What is maximum cardinality?

  • The maximum cardinality of a relationship is the maximum number of instances of entity B that may be associated with each instance of entity A.
  • Maximum cardinality: maximum number of entity instances that can participate in a relationship.
  1. One-to-One [1:1]
  2. One-to-Many [1:N]
  3. Many-to-Many [N:M]

To know more about maximum cardinality , refer:

brainly.com/question/18090451

#SPJ4

4 0
1 year ago
When excel follows the order of operations the formula 8 * 3 + 2 equals?
Airida [17]
It follows the normal convention of BODMAS , which is the order of precedence of operations , so the answer equals to 26
3 0
3 years ago
Other questions:
  • Cleaning the keyboard is the most important part of keeping your computer running at peak performance.
    5·2 answers
  • What is the formula for calculating the average of cells<br> C2 through C30?
    15·1 answer
  • What types of scientific claims should be verified
    5·1 answer
  • Name a piece of software you often use where it is easy to produce an error. Explain ways you could improve the interface to bet
    5·1 answer
  • I will have to goste yall im busting my butt off doing homework
    10·2 answers
  • Explain how mobile phone production could be more sustainable​
    8·2 answers
  • Whose task it is to ensure that the product flows logically from one step to another?
    14·1 answer
  • Noi needs to send some documents to a client in another company. Which device can she use to make digital copies of the paper fi
    13·2 answers
  • Which of these apps could be a Trojan Horse designed to install malware on your system? Select all that apply. *
    8·1 answer
  • A monitor is an output device. Which of the following is not a type of monitor? *
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!