Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are required to write an interactive C++ program that will manage and monito

ID: 673825 • Letter: Y

Question

You are required to write an interactive C++ program that will manage and monitor an inventory system for 5 days.

Initial Value and Inputs

You should start with at least 4 different items (label them 1-4) and assume there 5 of each as starting values.

Each day, customers select (buy) different quantity from each items based on their needs. They should provide the data as inputs (Item which labeled 1-4 and numbers acquired from each item).

You may create a simple menu to get the data , such as following:

Would like to purchase an item?                     If the answer is “yes” then, ask

Which item do you like to purchase?                         You may select from a number (1–4)

                                                            If a number is selected then, ask

How many would you like?                      Then customer can enter a number (1-5)

Program Requirements:

Program must be written interactively menu and request proper data from the user (customer).

Considering the transactions, each day you must report (print) the total sale of each item and the available number.

For each item, if the inventory less than or equal 20%, you should order and make sure to maintain the level of each inventory at 5 for each item.

Report (print) the status of each item at the end of 5 days.

The program should be fully documented.

Test your program for different set of data.

You should submit (hard copy and digital) the source code, executable file, and properly labeled output.

Explanation / Answer

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

int main()
{
string flag;
int opt,count,k;
int inv[5]={0,10,10,10,10};
do{
cout<<"Would you like to purchase and item?";
cin>>flag;
if(flag=="yes"){
cout<<"Which item do you like to purchase?";
cin>>opt;
if(opt>0&&opt<5){
cout<<"How many would you like?";
cin>>count;
if(count>inv[opt]){
cout<<"That Quantity not available"<<endl;
}else {
inv[opt]=inv[opt]-count;
if(inv[opt]<2){
cout<<"getting the inventory for item "<<opt<<endl;
inv[opt]=10;
}

}
}
else{
cout<<"Invalid item!!"<<endl;
break;
}
}else{
cout<<"Quitting"<<endl
break;
}

}while(true);

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote