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]
3 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]3 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
A simply supported wood roof beam is loaded with single point dead and roof live loads applied at midspan (PD = 400 lb, PLr = 16
Lynna [10]

Answer:mold i belive

Explanation:

3 0
3 years ago
A 75- kw, 3-, Y- connected, 50-Hz 440- V cylindrical synchronous motor operates at rated condition with 0.8 p.f leading. the mot
Thepotemich [5.8K]

78950W the answer

Explanation:

A 75- kw, 3-, Y- connected, 50-Hz 440- V cylindrical synchronous motor operates at rated condition with 0.8 p.f leading. the motor efficiency excluding field and stator losses, is 95%and X=2.5ohms. calculate the mechanical power developed, the Armature current, back e.m.f, power angle and maximum or pull out torque of the motor

A 75- kw, 3-, Y- connected, 50-Hz 440- V cylindrical synchronous motor operates at rated condition with 0.8 p.f leading. the motor efficiency excluding field and stator losses, is 95%and X=2.5ohms. calculate the mechanical power developed, the Armature current, back e.m.f, power angle and maximum or pull out torque of the motor

5 0
2 years ago
In part A you are asked to write the pseudocode for the program. In part B you are asked to write the syntax of the code for the
Naya [18.7K]

Answer:

C++.

Explanation:

#include <iostream>

#include <string>

using namespace std;

///////////////////////////////////////////////////////////////

int main() {

   string quote, book;

   int page;

   

   cout<<"What is your favorite quote from a book?"<<endl;

   getline(cin, quote);

   cout<<endl;

   /////////////////////////////////////////////

   cout<<"What book was that quote from?"<<endl;

   getline(cin, book);

   cout<<endl;

   /////////////////////////////////////////////

   cout<<"What page was that quote from?"<<endl;

   cin>>page;

   cout<<endl;

   /////////////////////////////////////////////

   int no_of_upper_characters = 0;

   for (int i=0; i<quote.length(); i++) {

       if (isupper(quote[i]))

          no_of_upper_characters++;

   }

   

   cout<<"No. of upper case characters: "<<no_of_upper_characters<<endl;

   /////////////////////////////////////////////

   int no_of_characters = quote.length();

   cout<<"No. of characters: "<<no_of_characters<<endl;

   /////////////////////////////////////////////

   bool isDog = false;

   for (int i=0; i<quote.length(); i++) {

       if (isDog == true)

           break;

       else if (quote[i] == 'd') {

           for (int j=i+1; j<quote.length(); j++) {

               if (isDog == true)

                   break;

               else if (quote[j] == 'o') {

                   for (int z=j+1; z<quote.length(); z++) {

                       if (quote[z] == 'g') {

                           isDog = true;

                           break;

                       }

                   }

               }

           }

       }

   }

   

   if (isDog == true)

       cout<<"This includes 'd' 'o' 'g' in the quote";

   //////////////////////////////////////////////

   return 0;

}

3 0
3 years ago
The regulated voltage of an alternator is stated as 13.6 to 14.6 volts at 3000 rpm with the
lions [1.4K]

Answer:

  d)  1 volt​

Explanation:

The allowable range is 1 volt​. The allowed tolerance (deviation from nominal) depends on what the nominal voltage is.

5 0
3 years ago
A polyethylene rod exactly 10 inches long with a cross-sectional area of 0.04 in2 is used to suspend a weight of 358 lbs-f (poun
Nadya [2.5K]

Answer:

Final length of the rod = 13.90 in

Explanation:

Cross Sectional Area of the polythene rod, A = 0.04 in²

Original length of the polythene rod, l = 10 inches

Tensile modulus for the polymer, E = 25,000 psi

Viscosity, \eta = 1*10^{9} psi -sec

Weight = 358 lbs - f

time, t = 1 hr = 3600 sec

Stress is given by:

\sigma = \frac{Force}{Area} \\\sigma = \frac{358}{0.04} \\\sigma = 8950 psi

Based on Maxwell's equation, the strain is given by:

strain = \sigma ( \frac{1}{E} + \frac{t}{\eta} )\\Strain = 8950 ( \frac{1}{25000} + \frac{3600}{10^{9} } )\\Strain = 0.39022

Strain = Extension/(original Length)

0.39022 = Extension/10

Extension = 0.39022 * 10

Extension = 3.9022 in

Extension = Final length - Original length

3.9022 =  Final length - 10

Final length = 10 + 3.9022

Final length = 13.9022 in

Final length = 13.90 in

7 0
2 years ago
Other questions:
  • Water flows down a rectangular channel that is 1.2 m wide and 1 m deep. The flow rate is 0.95 m/s. Estimate the Froude number of
    15·1 answer
  • Steam undergoes an isentropic compression in an insulated piston–cylinder assembly from an initial state where T1 5 1208C, p1 5
    15·1 answer
  • How do I cancel my subscription
    12·2 answers
  • A contractor needs to excavate 50,000 yd3 of silty clay and haul it with Caterpillar 69C dump trucks. Each truck can carry 30.9
    13·1 answer
  • Consider the freeway in Problem 1. At one point along this freeway there is a 4% upgrade with a directional hourly traffic volum
    15·2 answers
  • Determine the combined moment about O due to the weight of the mailbox and the cross member AB. The mailbox weighs 3.2 lb and th
    14·1 answer
  • Which of the following is an example of a social need?
    5·1 answer
  • if when you put your shirt in your pants, your shirt is tucked, does that mean when your shirt is over your pants, your pants ar
    6·2 answers
  • What is another term for the notes that a reader can add to text in a word-processing document?
    11·2 answers
  • How do all the cars work to move?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!