Question: #include #include #include #include using namespace std; class Time { private: int hours; int minutes; int seconds; string twoDigits ( const int num ) const;

#include
#include
#include
#include
using namespace std;
class Time
{
private:
int hours;
int minutes;
int seconds;
string twoDigits(const int num) const;
public:
void setHours(const int hrs);
void setMinutes(const int mins);
void setSeconds(const int secs);
int getHours() const;
int getMinutes() const;
int getSeconds() const;
string toString() const;
};
class Order
{
private:
double price;
int quantity;
string id;
Time time;
public:
void setPrice(const double cost);
void setQuantity(const int quant);
void setID(const string ident);
void setTime(const Time t);
double getPrice() const;
int getQuantity() const;
string getID() const;
Time getTime() const;
void display() const;
};
// FUNCTION PROTOTYPES GO HERE:
int main()
{
// Declare constant
vector orders;
// Call the function in TASK 6
// Write code to call the functions in TASK 13 and TASK 14
return 0;
}
// CLASS MEMBER FUNCTION DEFINITIONS GO HERE:
void Time::setHours(const int hrs)
{
hours = hrs;
}
void Time::setMinutes(const int mins)
{
minutes = mins;
}
void Time::setSeconds(const int secs)
{
seconds = secs;
}
int Time::getHours() const
{
return hours;
}
int Time::getMinutes() const
{
return minutes;
}
int Time::getSeconds() const
{
return seconds;
}
string Time::twoDigits(const int num) const
{
/* INSERT YOUR CODE */
}
string Time::toString() const
{
/* INSERT YOUR CODE */
}
void Order::setPrice(const double cost)
{
/* INSERT YOUR CODE */
}
double Order::getPrice() const
{
/* INSERT YOUR CODE */
}
void Order::setQuantity(const int quant)
{
/* INSERT YOUR CODE */
}
int Order::getQuantity() const
{
/* INSERT YOUR CODE */
}
void Order::setID(const string ident)
{
/* INSERT YOUR CODE */
}
string Order::getID() const
{
/* INSERT YOUR CODE */
}
void Order::setTime(const Time t)
{
/* INSERT YOUR CODE */
}
Time Order::getTime() const
{
/* INSERT YOUR CODE */
}
voi7.21 Project: Strings, Vectors, and Classes
Start Early
PLEASE START EARLY!
Work By Yourself
All Lab and Project assignments must be accomplished solely by you:
Abide by the University code of student conduct.
DO NOT look at anyones code other than your own, including code from another student in your section or another section of the course, or any third party source, e.g. the Internet.
DO NOT share or copy anyone elses code for any graded assignment. Do not post the assignment nor your solution ANYWHERE.
DO NOT work in pairs or groups.
Any violation of the above and statements in the syllabus will result in a report to the Committee On Academic Misconduct (COAM).
Programming Assignment
IMPORTANT: This assignment will have you use all course material covered so far including course material that is the focus of this assignment (Strings, Vectors, and Classes). Please study all lecture notes and pre-recorded lectures on Strings, Vectors, and Classes BEFORE starting this assignment.
Besides program behavior (compiles and passes tests), effective commenting, tabbing, code quality, and choice of statements will affect your grade. The style of your program should follow the style of the sample programs in the lecture notes. Your program should have the file name, your name, creation dates and a brief description of the program at the top of the file. In addition, read the document on Commenting found in the Content tab on Carmen under Tutorials.
To receive full credit, only use C++ statements presented in the lecture notes and assigned readings with the exception that you do NOT use the break and continue statements. Your solution will be graded based on passing test cases, formatting, good choice of variable and function names, defining functions properly, and the quality of your solution including proper use of const, proper use of pass-by-value vs pass-by-reference, choosing for vs while loops appropriately, avoiding repetitive code where a loop should be used, proper use of the if and if-else statements or avoiding them when unnecessary. Write your solution in the provided code template. You will implement member functions in the classes Time and Order, write code in the main function, and implement other functions.
An online store would like you to write a C++ program that reads, stores, and displays customer orders that occurred on a single day. Each order involves a single product and consists of an ID for the order, price of the product, quantity of the product, and the time of the order in military time using hours, minutes, and seconds.
DO NOT delete nor change the code already given to you in the code template. You will add your code to this template to formulate your solution. Here is a sample run of the code (user input is in bold):
> run
Enter today's orders:
Order #1-
ID: a1
Price: 20.50
Quantity: 1
d Order::display() const
{
/* INSERT YOUR CODE */
}
// FUNCTION DEFINITIONS GO HERE:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!