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 <

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
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);
|
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
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education