Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE 112 Introduction to Computer Science II CSE 112 - Lab #4 Corporate Sales - Constructors, Classes, and Input Validation Modified Programming Challenge #10 (CH

image text in transcribedimage text in transcribed

CSE 112 Introduction to Computer Science II CSE 112 - Lab \#4 Corporate Sales - Constructors, Classes, and Input Validation Modified Programming Challenge \#10 (CH 14, page 938 - \#10) with file reading. Implement the DivSales class that holds sales data for a division, with the array for the sales data by quarter, and a private static variable that holds the total sales for all sales divisions. Do not ask the user to enter the sales data. The program will create the array of six objects, and read the sales data below into the objects from a file called 'SalesFile.txt'. The program will then prompt the user for the division number (16) and output the sales for that division, and the total sales for that division as shown below. Use functions as you see fit. No input validation is required. Add a loop in main so that multiple numbers can be input and " 0 to quit. When the user enters ' 0 ' to quit, output the total sales for the corporation (the private static variable value). The program will use the class definition provided below in a separate *. h file, and use the class member functions to obtain the proper output (including the private static variable). Do not change the class. // Declaration of the DivSales class for the *.h file class Divsales \{ private: static double corpSales; double divSales; public: double qtrs[4]; void setDivSales(double s) { divSales = divSales +5;} void setCorpSales(double s) { corpSales = corpSales + si, } double getDivSales[) const \{return divSales; \} double getCorpSales() const \{return corpSales; \} \}? // Static member variable definition double DivSales:corpSales; 1 Assignments submitted after the due date will incur a grade penalty of three (3) points per day CSE 112 Introduction to Computer Science II Output Format - tabs and spacing required

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago