Reference no: EM13943304
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;
}
What cultural values shape your beliefs
: What cultural values shape your beliefs? How would you know whether you have stepped outside a cultural norm with regard to the social clock? Does a specific developmental theory support your personal views of healthy development for a young adult
|
Condition on attribute rating in table
: Write a CHECK constraint that expresses the following condition on attribute Rating in table Movies in Movie Database: "Any possible value of Rating is either a null value or a number in the interval from 0 to 10 inclusively".
|
Gas phase reaction takes place
: Question -4 following gas phase reaction takes place at 500oc 4PH3 (g) ----( P4 (g) +6H2 (g) With rPH = 85h^-1*CPH3 What is the volume of the plug flow reactor operating at this temperature and 5.5 atm, giving 80% conversion for a feed of 2.5 kg-mol..
|
Bonds outstanding that are selling at par value
: Jack's Construction Co. has 100,000 bonds outstanding that are selling at par value. The bonds yield 8.7 percent. The company also has 3.2 million shares of common stock outstanding. The stock has a beta of 1.3 and sells for $20 a share. The U.S. Tre..
|
Declarations in global or in void functions or main function
: 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.
|
What is the effective annual interest rate on the loan
: Faircross Farms harvests its crops four times annually and receives payment for its crop 3 months after it is picked and shipped. However, planting, irrigating, and harvesting must be done on a nearly continual schedule. What is the effective annual ..
|
How do you expect religion and philosophy disciplines
: How do you expect one (or more) of these disciplines-History, Religion, Philosophy - to help you understand the art that we'll explore
|
Exercise price of an option is equal to the current price
: The option seller, also called the option writer, sells (or writes) the option and has a short position in the contract. When the exercise price of an option is equal to the current price of the stock, the option is said to be at-the-money. A holder ..
|
What is monetary value of information from a consumer survey
: What is the monetary value of the information from a consumer survey to the venture capital company in this case? (ie what is the maximum that they should spend on a consumer survey)?
|