Answer to Question #212283 in C++ for fazily

Question #212283

C++ PROGRAMMING

The "TRC Institute" records and monitors performance of three (3) machines over a period of four (4) days (l to 4) as shown in the Table 1, 2 and 3 respectively. The production ranges between 15.5 and 75.5 

Table 1- Machine "A" Production

Day 1 2 3 4

Array index 0 1 2 3

Production 15.5 25.5 27.5 60.5

Table 2- Machine "B" Production

Day 1 2 3 4

Array index 0 1 2 3

Production 50 45.5 25.5 18

Table 3- Machine "C" Production

Day 1 2 3 4

Array index 1 2 3 4

Production 35.5 65 71 74.5

1) Write a function using C++ statements called AverageProduction() which takes three float values (valuel , value2, value3 ) as parameters and returns the average production. 2)Write a function using C++ statements called TotalProduction() which takes three float values (valuel , value2, value3) as parameters and returns the total production.


1
Expert's answer
2021-07-02T11:43:46-0400
#include <iostream>

using namespace std;

float table1[] {15.5, 25.5, 27.5, 60.5};
float table2[] {50, 45.5, 25.5, 18};
float table3[] {-1.0, 35.5, 65, 71, 74.5};

void GetProduction(float val1, float val2, float val3) {
  cout << "Machine A **" << endl;
  cout << "Machine B  *****" << endl;
  cout << "Machine C   ****" << endl;
}

void PrintBar(int day) {
  cout << "Day " << day << endl;
}

void PrintChar(float val1, float val2, float val3, int day)  
{
  PrintBar(day);
  GetProduction(val1, val2, val3);
}

int main() 
{  
  PrintChar();
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS