1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nonamiya [84]
4 years ago
15

Create a program, using at least one For Loop, that displays the Sales Amounts in each of 4 regions during a period of three mon

ths. The program should allow the user to enter 4 sets (one set for each region) of three sales amounts (one sales amount for each month). The program should display each regions total sales for the three month period, and the companies total sales (sum of the four regions for three months). Example data below (Remember, the user should be able to enter any data they wish, as long as it follows the below format: Region 1 - 1000, 2000, 3000 Region 2 - 3000, 4000, 6000 Region 3 - 1000, 3000, 2000 Region 4 - 2000, 2000, 4000
Engineering
1 answer:
kari74 [83]4 years ago
5 0

Answer:

C++ code explained below

Explanation:

/*C++ program that prompts sales for four regions of three sales and prints

the sales values to console */

#include<iostream>

#include<iomanip>

#include<cstring>

using namespace std;

int main()

{

  //set constant values

  const int SALES=3;

  const int REGIONS=4;

  //create an array of four regions

  string regionNames[]={"Region 1","Region 2","Region 3","Region 4"};

  //create a 2D array to read sales

  int sales[REGIONS][SALES];

  //read sales for four regions

  for(int region=0;region<REGIONS;region++)

  {

      cout<<regionNames[region]<<endl;

      for(int sale=0;sale<SALES;sale++)

      {

          cout<<"Enter sales ";

          cin>>sales[region][sale];

      }

  }

  //print sales

  for(int region=0;region<REGIONS;region++)

  {

      cout<<regionNames[region]<<"-";

      for(int sale=0;sale<SALES;sale++)

      {

          cout<<setw(5)<<sales[region][sale];

      }

      cout<<endl;

  }

  //pause program output on console

  system("pause");

  return 0;

}

You might be interested in
Marco wants to investigate the chemical properties of sodium bicarbonate, or baking soda. He plans to carry out the tests below.
Leya [2.2K]
Definitely test 2 because it will show if there is a chemical reaction of not
6 0
3 years ago
Read 2 more answers
Technician A says that weld-through primer can be removed from the immediate weld area to improve weld quality. Technician B say
lisabon 2012 [21]

Answer:

83737373777473737373738388383838

4 0
3 years ago
You wish to design a cantilever beam with a square cross section and length L that can support an end load of F without yielding
koban [17]

Answer:

with a square cross section and length L that can support an end load of F without yielding. You also wish to minimize the amount the beam deflects under load. What is the free variable(s) (other than the material) for this design problem?

a. End load, F.

b. Length, L.

c. Beam thickness, b

d. Deflection, δ

e. Answers b and c.

f. All of the above.

8 0
3 years ago
What are employers required to do to keep employees safe from caught-in and -between hazards from hand-held power tools?
nika2105 [10]

Answer:

Employees who use hand and power tools and who are exposed to the hazards of falling, flying, abrasive and splashing objects, or exposed to harmful dusts, fumes, mists, vapors, or gases must be provided with the appropriate equipment needed, including Personal Protective Equipment, to protect them from the hazard.

Explanation:

8 0
3 years ago
12. Which of the following letter doesn't still the same when its viewed
Mashcka [7]

Answer:

the correct answer is option B. W

3 0
3 years ago
Read 2 more answers
Other questions:
  • A multistage pump is required to deliver water to a head of 50 m at flow rate of 0.1 m^3/s. A motor rotating at 1800 rpm is avai
    8·1 answer
  • Which of the following can be used to create hydrogen? a. gasoline c. carbon monoxide b. carbon dioxide d. ammonia
    10·1 answer
  • The given family of functions is the general solution of the differential equation on the indicated interval.Find a member of th
    11·1 answer
  • Does a thicker core make an electromagnet stronger?
    15·2 answers
  • A) Consider an air standard otto cycle that has a heat addition of 2800 kJ/kg of air, a compression ratio of 8 and a pressure an
    7·1 answer
  • Which of the following is an acronym used in mechanical plans?
    11·1 answer
  • Two long pipes convey water between two reservoirs whose water surfaces are at different elevations. One pipe has a diameter twi
    13·1 answer
  • Which symbol warns that there is something wrong with your alternator?
    8·1 answer
  • Describe two fundamental reasons why flexural strength should depend on porosity
    14·1 answer
  • Technician A says the cooling system must be full for a pressure test to be effective. Technician B says the cooling system shou
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!