Purchase Solution

Lowest Score Drop

Not what you're looking for?

Ask Custom Question

Need help with coding a homework assignment in Visual C++ and all information is placed in the txt file attachment.

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;

}

Attachments
Purchase this Solution

Solution Summary

Lowest Score Drop is noted.

Solution Preview

//I have introduced a new variable int lowScorePos; //This variable is required to pinpoint
//the location of the lowest score within the array, so that we can
//avoid adding it to the total. Please note your existing approach(al-
//though not properly written) ...

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Javscript Basics

Quiz on basics of javascript programming language.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.