Use C to do this A concrete manufacturing company is develop

Use C++ to do this
A concrete manufacturing company is developing five new formulations to use for highways. To ensure that the formulations produce similar results when they are prepared by plants in different locations, the company has asked each of the seven plants to prepare each formulation and measure the compressive strength after 180 days of curing. You have been asked to develop a program to help analyze the data. Your program should have a main function and 3 other functions as described below.
One function should confirm that the entered value for compressive strength is between 15 and 75 MPa inclusive. This function should accept the compressive strength to be checked and the plant number that measured this strength and prompt the user to re-enter the compressive strength for that plant until a valid value is entered. This function should return a valid value to the function call.
One function should accept the 7 compressive strengths from a plant and send back to function the highest and lowest of the 7 compressive strengths to the function call.
One function should accept the 7 compressive strengths of a specific formulation and calculate the average of the strengths for that formulation without the highest and lowest strength. This function should call the function to determine the lowest and highest compressive strength for a plant, then calculate the average. The average should be returned to the function call.
The main function should prompt the user to enter the compressive strength for a formulation from each plant one at a time and call the function to ensure the entered value was valid . Next main should call the function to calculate the average of the values from the plants. This process should be repeated for each of the 5 formulations. The main function should output the average for each formulation to two decimal places.

Do not use arrays to complete this question.
Make sure that you have included the input needed from user to complete the problem, output expected from the program, and the processing needed to get the output from the input. The description of the purpose should be detailed enough that a person reading your code would not need any additional information to understand the problem.

Sample output is given below.
Enter the information for formulation 1.
Enter the compressive strength for formulation 1 in MPa from plant 1 26
Enter the compressive strength for formulation 1 in MPa from plant 2 28.4
Enter the compressive strength for formulation 1 in MPa from plant 3 45.6
Enter the compressive strength for formulation 1 in MPa from plant 4 20.4
Enter the compressive strength for formulation 1 in MPa from plant 5 36.2
Enter the compressive strength for formulation 1 in MPa from plant 6 29.1
Enter the compressive strength for formulation 1 in MPa from plant 7 18
The average strength for formulation 1 was 28.02.

Enter the information for formulation 2.
Enter the compressive strength for formulation 2 in MPa from plant 1 10
The compressive strength should be between 15 and 75 MPa!
Enter the strength from plant 1 90
The compressive strength should be between 15 and 75 MPa!
Enter the strength from plant 1 61.1
Enter the compressive strength for formulation 2 in MPa from plant 2 62.2
Enter the compressive strength for formulation 2 in MPa from plant 3 83.3
The compressive strength should be between 15 and 75 MPa!
Enter the strength from plant 3 63.3
Enter the compressive strength for formulation 2 in MPa from plant 4 61.4
Enter the compressive strength for formulation 2 in MPa from plant 5 15.5
Enter the compressive strength for formulation 2 in MPa from plant 6 13.6
The compressive strength should be between 15 and 75 MPa!
Enter the strength from plant 6 62.6
Enter the compressive strength for formulation 2 in MPa from plant 7 84.75
The compressive strength should be between 15 and 75 MPa!
Enter the strength from plant 7 64.75
The average strength for formulation 2 was 62.12.

Enter the information for formulation 3
.........

Enter the information for formulation 4
........

Press any key to continue . . .

Solution

#include <iostream>
#include<conio.h>
#include <iomanip>// for setprecision setting decimals
using namespace std;
int compressiveValue();
void highest_lowest();

int main(){


for(int i=1;i<6;i++){//repeating process for 5 formulations.
   cout<<\"Enter the compressive strength for formulation\" <<i<<\"in MPa from plant\";
   highest_lowest();
}


   //highest_lowest(); // calling function it cludes averae also
   getch();
   return 0;
  
}

int compressiveValue(){
int strength;
   cout<<\"Enter Valid Stregnth :\";
   cin>>strength;
while((strength <15) || (strength >75)) { // if not in range prompt the user to re-enter again
cout<<\"InValid Stregnth Re-enter between 15 and 75 :\";
       cin>>strength;
}//end if
return strength; // returning value
}


void highest_lowest(){
   int total =0;
   int highest,lowest,stren;
   for(int i=0;i<7;i++){
       cout<<\"Enter the compressive strength for formulation\"<<i+1<<\" in MPa from plant: \"<<i+1<<endl;
       stren=compressiveValue();
       total=total+stren;// finding total
       if(stren > highest){// finding highest and lowest
           highest=stren;
       }else if(stren < lowest){
           lowest=stren;
       }
   }
   float average=total/7;
   cout<<\"Highest:\"<<highest<<endl;
   cout<<\"Lowest:\"<<lowest<<endl;
   cout<<\"Average:\"<<setprecision (2) << fixed <<average<<endl;
}

Use C++ to do this A concrete manufacturing company is developing five new formulations to use for highways. To ensure that the formulations produce similar res
Use C++ to do this A concrete manufacturing company is developing five new formulations to use for highways. To ensure that the formulations produce similar res

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site