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 23:00
How do you know if the website is secure if you make a purchase
Answers: 2
question
Computers and Technology, 24.06.2019 03:00
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
question
Computers and Technology, 25.06.2019 01:30
What was the advantage of using transistors instead of vacuum tubes in the second-generation computers? a. computers were drastically reduced in size. b. computers no longer produced errors. c. computers became affordable. d. computers could run on electricity.
Answers: 1
question
Computers and Technology, 25.06.2019 05:00
How many meatballs required for a larty of 25 adults and 6 children
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
History, 23.03.2020 21:36
question
Biology, 23.03.2020 21:36
question
Mathematics, 23.03.2020 21:36
question
Mathematics, 23.03.2020 21:36
Questions on the website: 13722363