3.1 Task One: Program 10-12 (Page 637-638). (40 marks) (1)Input source code and compile it. Run the program and capture
Posted: Wed Apr 27, 2022 3:43 pm
3.1 Task One: Program 10-12 (Page 637-638). (40 marks) (1)Input source code and compile it. Run the program and capture screenshots of output. (20 marks) (2)Modify the program. Design and Encapsulate the data and functions in class Sales. Add two more member functions in this class to find The highest sales and The lowest sales. (20 marks) 19 class Sales private: int types; double array, public: //Function prototype Sales(int); -Sales(); void getSales(); double totalSales(); double highest Sale(); double lowest Sale(); }; Sales::Sales(int num) types num; array=new doubleſ types) or int main() { const int QUARTERS - 14://constant value can be changed Sales shop (QUARTERS); 1/optional method to implemenet getSale: // or getsale can be overloaded with different formal paramere(s) //(1) ask user to input from keyboard or //(2) read from data file //(3)send an exiting array to shop object 1.- shop.getSales(); // cout << setprecision(2); cout << fixed << showpoint; cout << "The total sales for the year are $"; cout <<shop. totalSales() << endl; cout << "The highest sale in the year is $"; cout <<shop. highest Sale() << endl; cout << "The lowest sale in the year is $"; cout <cshop. lowest Sale() << endl; (3)Run the program and capture screensho of output in report.