C++ programming Creating and Using a Class You will write a program to manage a
ID: 638459 • Letter: C
Question
C++ programming
Creating and Using a Class
You will write a program to manage a shopping list. The program should display a list of items. The user must be able to enter and edit the items. You will use a class for the items. The class should have data elements for the following information: item name, unit (i.e. can, or pounds, or ounces), number to buy, and unit price. You will implement creating the list, adding items, removing items, displaying the shopping list. The class description can be shown this way: List item string name string unit int nrwanted List item() //maybe? void?add item(string) void remove_item(string) void display_list() Before you start coding write out the design of your class. Then design the functions you will need. You will be working mostly with mutators and accesors. If you do the design properly the coding should be simple. NOTE: You only need to create and use this one class. You may create a List class to contain the other items but it is not required. For the last point of the grade. Add the following functions to the program. Read a saved list from a text file, and save a list to a text file.Explanation / Answer
#include #include #include class library { char author[15][20],title[15][20]; int price[15]; char pub[15][20]; int s; public: void getdata(void); void display(void); }; void library :: getdata(void) { couts; for(int i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.