Reference no: EM132193778
Write a C++ class that will use the "main" function as it is written below. You cannot change the "main" function. You must only insert commands in the "class" module.
The program prompts the user for four different food types and the best way to cook it. An example might be "cat" and the best way to prepare it might be "grilled".
After asking each of these questions four times, each of the food types and cooking methods are displayed on the console.
#include <iostream>
#include <string>
using namespace std;
class Food
{
You must write this part of the code
}
int main()
{
string type, bt;
cout << "Please enter a type for food 1: ";
getline(cin, type);
cout << "Please enter a cooking style for food 1 (ENTER for none): ";
getline(cin, bt);
Food f1(type, bt);
cout << "\nPlease enter a type for food 2: ";
getline(cin, type);
cout << "Please enter a cooking style for food 2 (ENTER for none): ";
getline(cin, bt);
Food f2(type, bt);
cout << "\nPlease enter a type for food 3: ";
getline(cin, type);
cout << "Please enter a cooking style for food 3 (ENTER for none): ";
getline(cin, bt);
Food f3(type, bt);
cout << "\nPlease enter a type for food 4: ";
getline(cin, type);
cout << "Please enter a cooking style for food 4 (ENTER for none): ";
getline(cin, bt);
Food f4(type, bt);
cout << "\nData for food 1:" << endl;
f1.showData();
cout << "\nData for food 2:" << endl;
f2.showData();
cout << "\nData for food 3:" << endl;
f3.showData();
cout << "\nData for food 4:" << endl;
f4.showData();
return 0;
}