write this program in c++ The goal of the project is to implement a simple Parts
ID: 646354 • Letter: W
Question
write this program in c++
The goal of the project is to implement a simple Parts inventory program for a hardware business. The functionality of this program will be limited. The program will perform the following tasks: 1. It will open an existing file containing the inventory. The inventory is stored as a set of records. Each record consists of four fields - Name of the Part, its ID, Quantity in stock and its Price. 2. It will display a menu of the functions available. The menu will look like this: 1. Find apart 2. Show inventory 99. Quit Make a selection: 3. The user can display the inventory or find a part. As you can see, the functionality of the application is limited. 4. If the user selects item 2, the application will display the inventory as shown below: 1. Find apart 2. Show inventoryExplanation / Answer
#include #include #include #include #include #include #include #include #include fstream inoutfile; //Menu Global Item#define pixTOrc(x) (8*(x-1)) //convert pixel into row and col format#define INC 5 //Increment Distance Between Menu Items#define ROW 15 //Row Value for Menu Item#define COL 8 //Column Value for Menu Item// To display the Inventory Main menu options typedef char option[15]; option mainMenu[]= { "New Record", "Display", "Search", "Updation", "Deletion", "Analysis", "Exit" }; /*-------------------Inventory Class--------------------*/class Inventory{ char itemNo[2],itemName[20]; int qty; double price,amt; public: char *getno(){return itemNo;} char *getitem(){ return itemName;} double getamt(){return amt;} void getdata(); void showdata(int,int); void showspecific(); void alterspecific(char *,char *); }; void Inventory :: getdata(){ gotoxy(30,12); coutitemNo; gotoxy(30,14); coutitemName; gotoxy(30,16); coutqty; gotoxy(30,18); coutprice; amt = price * qty; } void Inventory :: showdata(int x,int y){ gotoxy(x,y); cout.setf(ios::left,ios::adjustfield); coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.