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
Most technician jobs in the field of metrology require a college degree. True or False?
Elanso [62]

Answer:

True

Explanation:

Because I Said

7 0
3 years ago
Read 2 more answers
What will the following segment of code output? score = 95; if (score &gt; 95) cout &lt;&lt; "Congratulations!\n"; cout &lt;&lt;
Anarel [89]

Answer:

That's a high score!

This is a test question!

Explanation:

The reason these two lines are printed and not the first one is simple. After the 'IF' condition has been stated, there is no use of parenthesis such as { and } to enclose the next lines. This means that only the first line after the 'IF' condition may be read or skipped depending on whether the condition (score>95) is met. Since the score is not larger than 95, and the 'IF' condition fails, the line 'Congratulations!' is not printed. The next two lines of the code are read as normal because they do not depend on the 'IF' condition.

5 0
3 years ago
PROBLEM IN PICTURE HELP ME DEAR GODDDDDD UGHHH NONONO I HAVE 2 MINUTES TO FINISH THIS ❕❗️❕❗️❗️❕❕❕❕❗️❕❕❗️❕❗️❗️❗️❕‼️‼️‼️‼️❗️‼️❗️
Elan Coil [88]
Thx :) so much :))))))
4 0
3 years ago
Read 2 more answers
A pipe fitter would fabricate which one of the following systems?
Anettt [7]

Answer:

A

Explanation:

i just answered it on my test

4 0
2 years ago
For a steel alloy it has been determined that a carburizing heat treatment of 11-h duration will raise the carbon concentration
Jobisdone [24]

Answer:

Time =t2=58.4 h

Explanation:

Since temperature is the same hence using condition

x^2/Dt=constant

where t is the time as temperature so D also remains constant

hence

x^2/t=constant

2.3^2/11=5.3^2/t2

time=t^2=58.4 h

4 0
3 years ago
Other questions:
  • Nicholas wants to verify whether a file is a hard link to a file within the same directory. Which of the following commands coul
    6·1 answer
  • Choose the true statement from those shown below: A Merchant Account allows you to use SSL on your web site. Disadvantages of us
    14·1 answer
  • A large truck drives down the highway at 10 m/s hauling a rectangular trailer that is 6 m long, 2 m wide, and 2 m tall. The trai
    14·1 answer
  • For what two reasons do countries specialize? Countries specialize so that opportunity costs can be increased. Countries special
    13·1 answer
  • The grade is a measure of quality and it captures concentration levels (i.e., how pure a certain fraction is). If grade captures
    13·1 answer
  • Can someone please help me this is urgent!?
    12·2 answers
  • Determine the minimum required wire radius assuming a factor of safety of 3 and a yield strength of 1500 MPa.
    15·1 answer
  • 1. When and why should we use the Pattern option?
    12·1 answer
  • How many squares titles (20cm x 20cm) are needed to coat the sides and base of a pool which is 10m long, 6 meter wide and 3m dee
    8·1 answer
  • 3. (5%) you would like to physically separate different materials in a scrap recycling plant. describe at least one method that
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!