1-Includes a function “Display” to display the field values for each order that the item_price is greater than JD 100.
2-Includes a function “Search” to display the field values for each order that the customer name is “Ali”.
3-Write a main() function that contains an array of five Order objects and store appropriate data in it. Then, continue to prompt the user for Order data. Your program must calculate the total prices of the five orders.
4-Overloads an operator+() function to calculate the total price. In this function, you need to sum the prices of five orders.
5-Overloads an operator<() function to find the lowest order price of five orders.
You have a nice start on your class.You have covered #1, but #2 is missing.#3is started, but lacking.And 4 and 5 are missing.You do not need a "cout" and "endl" for every line and prefer to use the new line, (\n), over the function "endl".You could write the "display" function as:
1 2 3 4 5 6 7
cout <<
"The Customer Name is: " << Customer_name << "\n""The Customer Number is: " << Customer_number << "\n""The Item is: " << Item << "\n""The Quantity is: " << Quantity << "\n""The Unit price is: " << Unit_price << "\n""The Item price is: " << Item_price << '\n';
Using the insertation operator, (<<), you can chain as much as you need into 1 "cout" statement. And the end of line 2 and the beginning of line 3 are considered 1 string. Whether you write it this way or put the(\n) at the beginning of line 3 is up to you.Either way works.
Your "compute" function could simply return Quantity * Unit_price;.There is no need for the extra work.