Question

C++ Programming- CIS 1111 The CPlusPlus & LandMinusMinus Company needs you to write a program which...

C++ Programming- CIS 1111

The CPlusPlus & LandMinusMinus Company needs you to write a program which will produce a report, in both number and chart form, which will display Net Sales for their three company divisions, for any given month of the year entered by the user.

The corporate tax rate for the company is 30% (define as constant); the three division names are East-Coast, Mid-West, and West-Coast.

Requirements

  1. Have the user enter a month name, and then process each division sales/expenses, one at a time:
  2. Have the user enter the sales amount and expense amount for the division, using the division name as a prompt. Each sales and expense amount must be zero or greater.
  3. Calculate the net sales amount for the division (net sales = sales - expense, then subtract the corporate tax of 30% from the net sales to produce the required output shown in the screenshot below.
  4. After the three divisions are processed, display a Net Sales report which displays, for each division:
  5. A line showing the division name and its net sales, followed by an asterisk (*) for each $1,000 in net sales (i.e., if a division had $3,700 in net sales, 3 asterisks would be displayed). If a division’s net sales were less than $1,000, display a single hyphen instead of any asterisks (hint: use a loop to display the asterisks).
  6. Then process the next month name, or end the loop (unknown number of months).
  7. After all months are processed, display the average sales for a month, and the name of the month and its net sales amount for the month with the highest net sales.

Use this test data when creating the screen-print part of your assignment submission:

March (division: sales, expense)

East Coast: $15,000, $1,500

Mid West: $20,000, $1,000

West Coast: $18,500, $2,000

August (division: sales, expense)

East Coast: $25,000, $5,500

Mid West: $17,000, $1,000

West Coast: $14,500, $3,000

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>

#include<string>

using namespace std;

int main(){

int m = 3,i, j=0, ind;

string month[50], divisions[3];

double sales, expenses, netSales[3], max = 0, avg[50];

while(1){

cout<<"Enter month (-1 to exit): ";

cin>>month[j];

if(month[j]=="-1")

break;

for(i=0; i<3; i++){

cout<<"\nEnter Division: ";

getline(cin, divisions[i]);

getline(cin, divisions[i]);

while(1){

cout<<"Sales: ";

cin>>sales;

if(sales>=0)

break;

cout<<"sales must be zero or greater";

}

while(1){

cout<<"Expenses: ";

cin>>expenses;

if(expenses>=0)

break;

cout<<"Expenses must be zero or greater";

}

avg[j] += sales;

netSales[i] = (sales-expenses)-((sales-expenses)*0.3);

}

cout<<endl;

double monthNetSales = 0;

for(i=0; i<3; i++){

cout<<divisions[i]<<": $"<<netSales[i]<<" ";

monthNetSales += netSales[i];

if(netSales[i]<1000){

cout<<"-";

}

else{

double net = netSales[i];

while(net>1000){

cout<<"*";

net -=1000;

}

}

cout<<endl;

}

if(max<monthNetSales){

max = monthNetSales;

ind = j;

}

j++;

cout<<endl;

}

for(i=0; i<j; i++){

cout<<month[i]<<", Avg Sales: $"<<(avg[i]/3.0)<<endl;

}

cout<<"Highest Sales Month: "<<month[ind]<<", Net sales: "<<max<<endl;

}

Add a comment
Know the answer?
Add Answer to:
C++ Programming- CIS 1111 The CPlusPlus & LandMinusMinus Company needs you to write a program which...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ and Using Microsoft Visual Studio. Write 2 programs: One program will use a structure to...

    C++ and Using Microsoft Visual Studio. Write 2 programs: One program will use a structure to store the following data on a company division: Division Name (East, West, North, and South) Quarter (1, 2, 3, or 4) Quarterly Sales The user should be asked for the four quarters' sales figures for the East, West, North, and South divisions. The data for each quarter for each division should be written to a file. The second program will read the data written...

  • CIS 1111 Programming Files

    Description:In this assignment, you will write a program in C++ that uses files and nested loops to create a file for real estate agents home sales and then read the sales from the file and calculates the average sale for each agent. Each agent sold 4 homes.  Use a nested loop to write each agent’s sales to a file. Then read the data from the file in order to display the agent’s average sale and the average for all sales....

  • Help. Write a C++ program that determines which of a company's four divisions (North, South, East,...

    Help. Write a C++ program that determines which of a company's four divisions (North, South, East, West) has the greatest sales for the quarter. It should include three functions at a minimum: float getSales() is passed the name of a division. It asks the user for a division's quarterly sales figure, calls a validate() function that will validate the input, and then returns the value back to main(). This function should be called once for each division. void validate() is...

  • CProgramming using Dev C ++ #include <stdio.h> PLEASE NO math.h Corporate Sales Data Report Write a...

    CProgramming using Dev C ++ #include <stdio.h> PLEASE NO math.h Corporate Sales Data Report Write a program that read creates a structure for a company's divisions. The structure should have: Division name (North, South, East, West, and Central) Quarter (1, 2, 3, or 4) Quarterly sales · Your job is to write a program that will create a two-dimensional array of 5 rows (divisions) and 4 columns (quarters). The program should ask the user to enter in all four quarters...

  • Write a program that determines which of a company's eight divisions (North, South, East, West, Northeast,...

    Write a program that determines which of a company's eight divisions (North, South, East, West, Northeast, Southeast, Northwest, Southwest) had the greatest sales for a quarter. It should include the following two functions which are called only by main. double getSales() - it is passed the name of a division. It asks the user for a division's quarterly sales figure, validates the input then returns it. It should be called once for each division. Negative dollar amounts are invalid. void...

  • guys need help please im super lost anyone save me do programming exercise top_div_array.cpp: Winning Division...

    guys need help please im super lost anyone save me do programming exercise top_div_array.cpp: Winning Division app (top_div.cpp) revisited to use arrays This is the same program done last week but using and passing arrays instead of individual variables. Start with the following file / cODE BELOW: // Name: top_div_array.cpp // Description: // This app inputs sales for four regional division and displays the highest. // To accomplish this, use two arrays of equal length - one for sales and...

  • C++ 18. Savings Account Balance Write a program that calculates the balance of a savings account...

    C++ 18. Savings Account Balance Write a program that calculates the balance of a savings account at the end of a three month period. It should ask the user for the starting balance and the annual interest rate. A loop should then iterate once for every month in the period, performing the following A) Ask the user for the total amount deposited into the account during that month. Do not accept negative numbers. This amount should be added to the...

  • how to make this program for c++ visual studio 2015. Also, can I show your working...

    how to make this program for c++ visual studio 2015. Also, can I show your working and program. Also, Can you have notice for pseudo code? For the first problem, please implement Problem 4 on page 142 (p 143, 7E) of the text. A scan of the problem is provided below. This problem asks you to calculate the average rainfall for three months. The program should ask the user to enter the name of each month, such as June or...

  • i need this to be in OOP using C++ 25. Savings Account Balance Write a program...

    i need this to be in OOP using C++ 25. Savings Account Balance Write a program that calculates the balance of a savings account at the end of a three-month feried. It should ask the user for the starting balance and the annual interest rate. A loop abculd then iterate once for every month in the period, performing the following steps: B) A) Ask the user for the total amount deposited into the account during that month and add it...

  • The XYZ Company needs you to write a program that will allow them to enter the...

    The XYZ Company needs you to write a program that will allow them to enter the weekly sales for a salesperson and then the program will calculate things such as most sales (and what day on which they happened), least sales (and day on which they happened), total sales, and daily average. The program will need to do the following: • Validate the user input to ensure that it is not less than 0.0 (0.0 will be acceptable if there...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT