you please help me solve the foll main.cpp Mnclude #ndude #include "Shopping Carth #include tomToPurchase.h Andude using namespace std; void PrintMenu(Shopping Cart cart1) { char userinput string item Name: string item Description; double itemPrice int temQuantity: enquanny while(userinput = q) ( cout<<"MENU" << endl; cout<<"a-Add item to cart << end. cout<<"d-Remove item from cart << end coute Change item quantity" << end coute-Output items' descriptions" << end cout<"o-Output shopping cart << end; cout <<"q-Qur << end << end; userinput while (userinput-o' && userinput Y && userinput ! 'e' && userinputte d && userinput 'a' && userinput='q) { - cout<<"Choose an option" << endl cin>> userinput } switch (userinput) { case a cout<<"ADD ITEM TO CART" << end; cin ignore cout<<"Enter the item name" << endl godineicin, itemName) cout <<"Enter the item description" << endl getineicin, itemDescription) cout<<"Enter the item price" << end; cin >> itemPrice cout<<"Enter the item quantity" << end << endl; cin>> itemQuantity Item To Purchase item 1(temName, item Description, itemPrice, itemQuantity) cart1 Additem(tem1) break; } case 'd: ( cout<<"REMOVE ITEM FROM CART" << endl cout <<"Enter name of item to remove << end << end cin ignore() getti neicin, itemName): Item To Purchase item1; item1. SetName(temName) cart1 Removeltem(tem1) break; } case 'c:{ ItemToPurchase item1; cout <"CHANGE ITEM QUANTITY << end. cout<<"Enter the item name" << endl cin ignore gedineicin, itemName): cout<<"Enter the new quantity" << endl cin>>> itemQuantity. Rem1 SetName(itemName) item1 SetQuantity(itemQuantity) cart1 Modifyltem(item 1) break; } case":{ cout<<"OUTPUT ITEMS DESCRIPTIONS" << endl; cart1 PrintDescriptions() break; } case'o':{ cout <
you please help me solve the foll main.cpp Mnclude #ndude #include "Shopping Carth #include tomToPurchase.h Andude using namespace std; void PrintMenu(Shopping Cart cart1) { char userinput string item Name: string item Description; double itemPrice int temQuantity: enquanny while(userinput = q) ( cout<<"MENU" << endl; cout<<"a-Add item to cart << end. cout<<"d-Remove item from cart << end coute Change item quantity" << end coute-Output items' descriptions" << end cout<"o-Output shopping cart << end; cout <<"q-Qur << end << end; userinput while (userinput-o' && userinput Y && userinput ! 'e' && userinputte d && userinput 'a' && userinput='q) { - cout<<"Choose an option" << endl cin>> userinput } switch (userinput) { case a cout<<"ADD ITEM TO CART" << end; cin ignore cout<<"Enter the item name" << endl godineicin, itemName) cout <<"Enter the item description" << endl getineicin, itemDescription) cout<<"Enter the item price" << end; cin >> itemPrice cout<<"Enter the item quantity" << end << endl; cin>> itemQuantity Item To Purchase item 1(temName, item Description, itemPrice, itemQuantity) cart1 Additem(tem1) break; } case 'd: ( cout<<"REMOVE ITEM FROM CART" << endl cout <<"Enter name of item to remove << end << end cin ignore() getti neicin, itemName): Item To Purchase item1; item1. SetName(temName) cart1 Removeltem(tem1) break; } case 'c:{ ItemToPurchase item1; cout <"CHANGE ITEM QUANTITY << end. cout<<"Enter the item name" << endl cin ignore gedineicin, itemName): cout<<"Enter the new quantity" << endl cin>>> itemQuantity. Rem1 SetName(itemName) item1 SetQuantity(itemQuantity) cart1 Modifyltem(item 1) break; } case":{ cout<<"OUTPUT ITEMS DESCRIPTIONS" << endl; cart1 PrintDescriptions() break; } case'o':{ cout <
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
Related questions
Question
Help me with this quickly. don't send answer with plagiarism.
![Can you please help me solve the following errors? I tried doing it by myself but I can't fix it. The errors are below the code.
main.cpp
#include <iostream>
#include <string>
#include "ShoppingCart.h"
#include "ItemToPurchase.h
#include <string>
using namespace std;
void PrintMenu(Shopping Cart cart1) {
char userinput
string itemName;
string item Description;
double itemPrice;
int itemQuantity:
while (userInput != 'q') {
cout << "MENU" << endl;
cout << "a - Add item to cart" << endl;
cout<"d-Remove item from cart << end;
cout << "c Change item quantity" << endl;
cout<<"-Output items' descriptions" << endl;
cout << "o-Output shopping cart" <<< endl;
cout << "q-Quit"' << end << endl;
userinput =
while (userinput != 'o' && userInput != '' && userinput != 'c' && userinput != 'd' && userInput != 'a' && userInput != 'q') {
cout << "Choose an option." << endl;
cin >> userinput;
}
switch (userinput) {
case 'a': (
cout << "ADD ITEM TO CART" << end;
cin. ignore():
cout<<"Enter the item name:" << endl;
getline(cin, itemName);
cout<<"Enter the item description" << endl
getline(cin, itemDescription);
cout<<"Enter the item price:" << endl;
cin >> itemPrice;
cout << "Enter the item quantity:" << end << endl;
cin>>itemQuantity:
ItemToPurchase item 1(itemName, item Description, itemPrice, itemQuantity)
cart1. Additem(item1);
break;
}
case 'd': (
cout << "REMOVE ITEM FROM CART' << endl;
cout < "Enter name of item to remove:"<<endl << endl;
cin.ignore())
getline(cin, itemName);
ItemToPurchase item1;
item 1. SetName(itemName);
cart1.Removeltem(item1)
break;
}
case 'c': {
ItemToPurchase item1;
cout << "CHANGE ITEM QUANTITY" << endl;
cout << "Enter the item name" << endli
cin.ignore():
getline(cin, itemName);
cout<<"Enter the new quantity:" << endl;
cin >> itemQuantity,
item1. SetName(itemName);
item1. SetQuantity (itemQuantity);
cart1. Modifyltem(item 1);
break;
}
case: {
cout << "OUTPUT ITEMS' DESCRIPTIONS" << endl;
cart1. PrintDescriptions();
break;
}
case'o': {
cout << "OUTPUT SHOPPING CART'<<endl;
cart1.PrintTotal():
break;
}
case'q':
break;
default:
break;
}
}
int main()
{
string CustomerName;
string CurrentDate;
cout<<"Enter customer's name:" << endl;
getline(cin, CustomerName);
cout << "Enter today's date:" << endl << endl;
getlineicin, CurrentDate);
Shopping Cart cart1 = ShoppingCart CustomerName, CurrentDate);
cout << "Customer name:" << cart1.GetCustomerName() << endl;
cout <"Today's date: "<< cart1.GetDate() <<endl << endl;
PrintMenu(cart1);
return 0;
}
Errors:
main.cpp: In function "bool testPassed(std:ofstream&)'";
main.cpp:105:14: error: too few arguments to function 'void PrintMenu(ShoppingCart)'
105 PrintMenu();
1
A
main.cpp 9.6: note: declared here.
9 void PrintMenu(ShoppingCart cart1) {
I
main.cpp: In function "bool testPassedistd::ofstream&)':
main.cpp:108:4: error: 'ExecuteMenu was not declared in this scope
108 ExecuteMenu(userOption, myCart);
|](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F49cd46cc-aa88-4717-89d9-bb561288d0dd%2F220bf62d-0642-4d08-a46b-e7bc472e1643%2F10aizaa_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Can you please help me solve the following errors? I tried doing it by myself but I can't fix it. The errors are below the code.
main.cpp
#include <iostream>
#include <string>
#include "ShoppingCart.h"
#include "ItemToPurchase.h
#include <string>
using namespace std;
void PrintMenu(Shopping Cart cart1) {
char userinput
string itemName;
string item Description;
double itemPrice;
int itemQuantity:
while (userInput != 'q') {
cout << "MENU" << endl;
cout << "a - Add item to cart" << endl;
cout<"d-Remove item from cart << end;
cout << "c Change item quantity" << endl;
cout<<"-Output items' descriptions" << endl;
cout << "o-Output shopping cart" <<< endl;
cout << "q-Quit"' << end << endl;
userinput =
while (userinput != 'o' && userInput != '' && userinput != 'c' && userinput != 'd' && userInput != 'a' && userInput != 'q') {
cout << "Choose an option." << endl;
cin >> userinput;
}
switch (userinput) {
case 'a': (
cout << "ADD ITEM TO CART" << end;
cin. ignore():
cout<<"Enter the item name:" << endl;
getline(cin, itemName);
cout<<"Enter the item description" << endl
getline(cin, itemDescription);
cout<<"Enter the item price:" << endl;
cin >> itemPrice;
cout << "Enter the item quantity:" << end << endl;
cin>>itemQuantity:
ItemToPurchase item 1(itemName, item Description, itemPrice, itemQuantity)
cart1. Additem(item1);
break;
}
case 'd': (
cout << "REMOVE ITEM FROM CART' << endl;
cout < "Enter name of item to remove:"<<endl << endl;
cin.ignore())
getline(cin, itemName);
ItemToPurchase item1;
item 1. SetName(itemName);
cart1.Removeltem(item1)
break;
}
case 'c': {
ItemToPurchase item1;
cout << "CHANGE ITEM QUANTITY" << endl;
cout << "Enter the item name" << endli
cin.ignore():
getline(cin, itemName);
cout<<"Enter the new quantity:" << endl;
cin >> itemQuantity,
item1. SetName(itemName);
item1. SetQuantity (itemQuantity);
cart1. Modifyltem(item 1);
break;
}
case: {
cout << "OUTPUT ITEMS' DESCRIPTIONS" << endl;
cart1. PrintDescriptions();
break;
}
case'o': {
cout << "OUTPUT SHOPPING CART'<<endl;
cart1.PrintTotal():
break;
}
case'q':
break;
default:
break;
}
}
int main()
{
string CustomerName;
string CurrentDate;
cout<<"Enter customer's name:" << endl;
getline(cin, CustomerName);
cout << "Enter today's date:" << endl << endl;
getlineicin, CurrentDate);
Shopping Cart cart1 = ShoppingCart CustomerName, CurrentDate);
cout << "Customer name:" << cart1.GetCustomerName() << endl;
cout <"Today's date: "<< cart1.GetDate() <<endl << endl;
PrintMenu(cart1);
return 0;
}
Errors:
main.cpp: In function "bool testPassed(std:ofstream&)'";
main.cpp:105:14: error: too few arguments to function 'void PrintMenu(ShoppingCart)'
105 PrintMenu();
1
A
main.cpp 9.6: note: declared here.
9 void PrintMenu(ShoppingCart cart1) {
I
main.cpp: In function "bool testPassedistd::ofstream&)':
main.cpp:108:4: error: 'ExecuteMenu was not declared in this scope
108 ExecuteMenu(userOption, myCart);
|
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,