subject

C++Given a ListItem class, complete main() using the built-in list type to create a linked list called shoppingList. The program should read items from input (ending with -1), adding each item to shoppingList, and output each item in shoppingList using the PrintNodeData() function. Ex. If the input is:-1the output is:.cpp#include "ListItem. h"#include #include #include using namespace std;int main (int argc, char* argv[]) {// TODO: Declare a list called shoppingList of type ListItemstring item;// TODO: Read inputs (items) and add them to the shoppingList list// Read inputs until a -1 is input// TODO: Print the shoppingList list using the PrintNodeData() functionreturn 0;}ListItem. h#ifndef LISTITEMH#define LISTITEMH#include using namespace std;class ListItem {public:ListItem();ListItem(string itemInit);// Print this nodevoid PrintNodeData();private:string item;};#endifListItem. cpp#include "ListItem. h"#include ListItem::ListItem() {item = "";}ListItem::ListItem(string itemInit) {item = itemInit;}// Print this nodevoid ListItem::PrintNodeData() {cout << item << endl;}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:00
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Stops: using the information learned in this course, explain three things you will not do when driving. a. b. c. explain why you will not do these things when driving. starts: using the information learned in this course, explain three things you will do when driving. a. b. c. explain why you will do these particular things when driving. explain one thing you will stop doing as a passenger. explain one thing you will start doing as a passenger.
Answers: 3
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
question
Computers and Technology, 25.06.2019 01:30
Once a vulnerability has been identified by nessus, where would you check for more information regarding the identified vulnerability, exploits, and any risk mitigation solution?
Answers: 1
You know the right answer?
C++Given a ListItem class, complete main() using the built-in list type to create a linked list call...
Questions
question
Biology, 23.06.2019 14:00
question
Chemistry, 23.06.2019 14:00
Questions on the website: 13722361