subject

Assignment: Design an inventory class that stores the following members:
serialNum: an integer that holds a part’s serial number
manufactDate: a member that holds the date the part was manufactured
lotNum: an integer that holds the part’s lot number
The class should have appropriate member functions (interfaces) for storing data into, and retrieving data from, these members.
Then, design a program that uses the queue class. The type of the queue should be the above inventory. The program should have a loop that asks the user whether he or she wishes to add a part to inventory or take a part from inventory. The loop should repeat until the user is finished.
If the user wishes to add a part to inventory, the program should ask for the serial number, date of manufacture, and lot number. The information should be stored in an inventory object using inventory interfaces and added into the inventory queue.
If the user wishes to take a part from inventory, the program should remove the front part from the queue and display the contents of its member variables.
When the user finishes, the program should display the contents of the member values of all the objects that remain in the queue.
What I have so far: (I get 3 errors. 2 of which tell me: "binary '>>'/'<<': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)" on lines 37 and 56 of my Header. H file.)
Header. h
#include
#include
#define SIZE 20
using namespace std;
class inventory {
public:
int serialNum, lotNum;
string manufactDate;
};
class Queue {
inventory inv[SIZE];
int front, rear;
public:
Queue()
{
rear = -1;
front = 0;
}
void enqueue()
{
if (rear >= SIZE)
{
cout << "queue is full";
}
else
{
rear++;
cout << "Enter Serial Num: ";
cin >> inv[rear].serialNum;
cout << "Enter Manufacturing Date(MM/DD/): ";
cin. getline >> inv[rear].manufactDate;
cout << "Enter Lot Num: ";
cin >> inv[rear].lotNum;
}
}
void pop()
{
if (front>rear)
{
cout << "queue is empty";
}
else
{
cout << "\nRemoved part details:\n";
cout << "\nSerial Num: " << inv[front].serialNum;
cout << "\nManufacturing Date: " << inv[front].manufactDate;
cout << "\nLot Num: " << inv[front].lotNum;
front++;
}
}
};
Main. cpp
#include "Header. h";
int main()
{
Queue q;
int choice;
do {
cout << "\n\nMENU\n"
<< "1. Store\n"
<< "2. Remove\n"
<< "3. Exit\n\n"
<< "Enter choice: ";
cin >> choice;
switch (choice)
{
case 1:
q. enqueue();
break;
case 2:
q. pop();
break;
case 3:
cout << "\nExiting";
break;
}
} while (choice != 3);
return 0;

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Amara created a workbook to track the number of minutes she reads each week. each day, she entered the number of minutes into the workbook. identify the types of data in the workbook using the drop-down menus.
Answers: 3
question
Computers and Technology, 21.06.2019 23:30
You picked the corridor which led you here. if the guards find you, they're going to be really angry! what is the synonym of angry
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is: censoredex: if userinput is "dang, that was scary! ", then output is: dang, that was scary! note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.#include #include using namespace std; int main() {string userinput; getline(cin, userinput); int ispresent = userinput.find("darn"); if (ispresent > 0){cout < < "censored" < < endl; /* your solution goes here */return 0; }
Answers: 3
You know the right answer?
Assignment: Design an inventory class that stores the following members:
serialNum: an intege...
Questions
question
Mathematics, 08.01.2021 21:10
question
Mathematics, 08.01.2021 21:10
question
Social Studies, 08.01.2021 21:10
question
Mathematics, 08.01.2021 21:10