Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include <iostream> #include <cmath> #include <iomanip> const int NUMBER_OF_PLAN

ID: 3644740 • Letter: #

Question

#include <iostream>
#include <cmath>
#include <iomanip>
const int NUMBER_OF_PLANTS = 4;

void input_data(int a[], int last_plant_number);

void print_asterisks(int);
void scale(int a[], int size);

void graph(const int asterisk_count[], int last_plant_number);

void get_total(int& sum);

int roundd(double number);


int main( )
{
using namespace std;
int production[NUMBER_OF_PLANTS];

cout << "This program displays a graphshowing "
<<"production for each plant in the company. ";

input_data(production, NUMBER_OF_PLANTS);
scale(production, NUMBER_OF_PLANTS);
graph(production, NUMBER_OF_PLANTS);

system("pause");
return 0;
}
void print_asterisks(int n)
{int i;
using namespace std;
for(i=0;i<n;i++)
cout<<"*";
cout<<endl;
}
void input_data(int a[], int last_plant_number)

{
using namespace std;
for (int plant_number = 1;
plant_number <= last_plant_number; plant_number++)
{
cout << endl
<< "Enter production data for plant number "
<< plant_number << endl;
get_total(a[plant_number- 1]);
//cout<<plant_number-1<<""<<a[plant_number-1]<<endl;
}
}



void get_total(int& sum)

{
using namespace std;
cout << "Enter number of units produced byeach department. "
<< "Append anegative number to the end of the list. ";

sum = 0;
int next;
cin >> next;
while (next >= 0)
{
sum = sum + next;
cin >> next;
}

cout << "Total = " << sum <<endl;
}


void scale(int a[], int size)
{
for (int index = 0; index < size;index++)
a[index] =roundd(a[index]/1000.0);
}



int roundd(double number)
{
using namespace std;
return static_cast<int>(floor(number +0.5));
}
void graph(const int asterisk_count[], int last_plant_number)
{
using namespace std;
cout << " Units produced in thousands ofunits: ";
for (int plant_number = 1;
plant_number <= last_plant_number; plant_number++)
{
cout << "Plant #"<< plant_number << " ";
print_asterisks(asterisk_count[plant_number - 1]);
cout << endl;
}
}
/*
void graph(const int a[], int n)
{
using namespace std;
int i,j,max=a[0];
for(i=1;i<n;i++)
if(a[i]>max)
max=a[i];
char graph[max][n];
for(i=0;i<max;i++)
for(j=0;j<n;j++)
graph[i][j]=' ';
for(i=0;i<n;i++)
for(j=0;j<a[i];j++)
graph[j][i]='*';
cout << " Units produced in thousands ofunits: ";
for(i=max-1;i>=0;i--)
{cout<<setw(3)<<i<<" ";
for(j=0;j<n;j++)
cout<<graph[i][j]<<" ";
cout<<endl;
}
for(i=0;i<n;i++)
{if(i==0)
cout<<" ";
cout<<" plant ";
}
cout<<endl;

for(i=0;i<n;i++)
{if(i==0)
cout<<" ";
cout<<" "<<i+1<<" ";
}
cout<<endl;

} */

I was wondering if someone could help me out and send me a screen shot of this program. I am having issues with my compiler and I need it for my class.

Explanation / Answer

what data should I enter?? I mean do you have some particular data result? or any data is okay?