Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modified Programming Challenge # 1 0 ( page 9 3 8 ) with Test Cases and file reading. Implement the DivSales class that holds sales

Modified Programming Challenge #10(page 938) with Test Cases and 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 (do not use while(true), while(1), break or continue) 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 + s; } void setCorpSales(double s){ corpSales = corpSales + s; } double getDivSales() const { return divSales; } double getCorpSales() const { return corpSales; }}; // Static member variable definition double DivSales::corpSales; Output Format tabs and spacing required: Date for "SalesFile.txt"1150.011151.021152.031153.041250.051251.061252.071253.081350.091351.101352.111353.121450.131451.141452.151453.161550.171551.181552.191553.201650.211651.221652.231653.24 I need help in using visual basic for C++

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_2

Step: 3

blur-text-image_3

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

=+c. If you were to learn that a bottle of Gatorade

Answered: 1 week ago