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, 22.06.2019 12:50
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks.requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
What is the name of the sound effect that danny hears
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
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
Mathematics, 12.02.2021 03:00
question
Mathematics, 12.02.2021 03:00
question
Mathematics, 12.02.2021 03:00
Questions on the website: 13722363