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 twoDigitsconst int num const;
public:
void setHoursconst int hrs;
void setMinutesconst int mins;
void setSecondsconst 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 setPriceconst double cost;
void setQuantityconst int quant;
void setIDconst string ident;
void setTimeconst 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
Write code to call the functions in TASK and TASK
return ;
CLASS MEMBER FUNCTION DEFINITIONS GO HERE:
void Time::setHoursconst int hrs
hours hrs;
void Time::setMinutesconst int mins
minutes mins;
void Time::setSecondsconst int secs
seconds secs;
int Time::getHours const
return hours;
int Time::getMinutes const
return minutes;
int Time::getSeconds const
return seconds;
string Time::twoDigitsconst int num const
INSERT YOUR CODE
string Time::toString const
INSERT YOUR CODE
void Order::setPriceconst double cost
INSERT YOUR CODE
double Order::getPrice const
INSERT YOUR CODE
void Order::setQuantityconst int quant
INSERT YOUR CODE
int Order::getQuantity const
INSERT YOUR CODE
void Order::setIDconst string ident
INSERT YOUR CODE
string Order::getID const
INSERT YOUR CODE
void Order::setTimeconst Time t
INSERT YOUR CODE
Time Order::getTime const
INSERT YOUR CODE
voi 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, eg 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 prerecorded 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 passbyvalue vs passbyreference, choosing for vs while loops appropriately, avoiding repetitive code where a loop should be used, proper use of the if and ifelse 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 #
ID: a
Price:
Quantity:
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
