You may use any C++ compiler for the programming assignment You should have 2 separate files for homework #4. 1) In Week.h file, #include .....
You may use any C++ compiler for the programming assignment
You should have 2 separate files for homework #4.
1) In Week.h file,
#include ..... // put the correct header file here
class Week { public: static const size_t arraySize{9}; explicit Week( ) { for( size_t i{0}; i items ) { for( size_t i{0}; i
// This class does not have get function since the data is an array
//
double calculate(double sales) { ............ // calculate the salary here return salary; } void update( double salary) { // use if statement to find salary is in which range // increase the appropriate array range } void display( ) { // display the results here }
private: std::array ranges;
};
2) In Lab4.cpp file,
#include ..... // put the correct header files here
int main( ) {
Week myWeek; double sales; double salary; cout > sales; while( sales >= 0 ) { salary = myWeek.calculate(sales); myWeek.update(salary); cout > sales; } myWeek.display(); return 0; }
Use a single-subscripted array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000 or a total of $650. Write a program (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount): a) $200-$299 b) $300-$399 c) $400-$499 d) $500-$599 e) $600-$699 f) $700-$799 $800-$899 h) $900-$999 1) $1000 and over Summarize the results in tabular format. You must create 2 separate files for this homework assignment. The Week.h file contains the class Week. The lab4.cpp file contains the main function. Please see the example on page 300 to 305 in your textbook. Sample Run OX C E:\Lab4\Lab4.exe Enter a sales amount Enter a sales amount Enter a sales amount Enter a sales amount Enter a sales amount Enter a sales amount Enter a sales amount Enter a sales amount Enter a sales amount Enter a sales amount (negative to end): 1000 (negative to end): 3000 (negative to end): 3000 (negative to end): 5000 (negative to end): 5000 (negative to end): 5000 (negative to end): 7000 (negative to end): 9000 (negative to end): 12000 (negative to end): -1 Range $200 $299 $300 $399 $400 $499 $500 $599 $600 $699 $700 $799 $800 $899 $900 $999 $1000 and over Number 1 0 2 0 3 0 1 0 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started