Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / These are the guidelines for flow on control in the program

These are the guidelines for flow on control in the program

Computer Science

These are the guidelines for flow on control in the program. each void function only called one time in program execution. Need help with correcting the code to run and the general code I working with is at the bottom. Seriously need help to get this code running. Thank you for any help you can provide.
-----------------------------------------------------------------------------
Declarations in global or in void functions or main--} only where necessary.
1.void getScore(); ///Ask user for score and store in reference parameters - Main can only be called once for each set of 5 scores to entered once.

2.void findLowest( int testScore[], int sz );/// - Main only called once-pass all 5values to calcAverage function to determine the lowest score to drop from execution.

3.void calcAverage ( );--Calculate and display average of the highest for 4 scores and drop lowest score value. Return flow to main and main ends program
-------------------------------------------------------------
int main() -- main ends flow of control.
{
1, 2, 3, end
}
--------------------------------------------------------------
The code i AM WORKING WITH below:
|
|
|
----------------------------------------------------------------
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

float lowest;
float i;
double avg;

float grades;

float Score1;
float Score2;
float Score3;
float Score4;
float Score5;

float testScore;
float lowScore;

int sz=5;

//********************************
//Function Prototype
void getScore();
void findLowest( int testScore[], int sz );
void calcAverage ( );
//*******************************

void getScore()
{

float Score1, Score2, Score3, Score4, Score5;

cout << "Enter in 5 test scores and I will store ";
cout << "them in variables. ";
cin >> Score1 >> Score2 >> Score3 >> Score4 >> Score5;
cout << fixed << showpoint << setprecision(5);
}

void findLowest( float testScore[], int sz )
{

float lowest = testScore[0]; // make the first element of the array the lowest.
// loop through the array and compare the rest with
// first element.

for ( int i = 0; i < sz; i++ )
{
if ( testScore[i] < lowest )
{
lowest = testScore[i];
}
}

cout << "The lowest is " << lowest << endl;

}
void calcAverage()
{

for ( float i = 0.0; sz < i; i++ )
{
if ( i > lowest )
{
i*= (float (Score1), float (Score2), float (Score3), float (Score4));
avg = (i)/4.0;
}
}

cout << "The Average is " << avg << endl;
}

int main( )
{
cout << "Using Functions ";
cout << "to calculate the average of a series of functions.";
getScore();
findLowest(float testScore(i*), int sz );
calcAverage();
cout << "calculate the average of a ";
cout << "series of functions.";
return 0;

}

Option 1

Low Cost Option
Download this past answer in few clicks

2.89 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE