Declarations in global or in void functions or main function

Assignment Help Operating System
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;

}

Reference no: EM13943304

Questions Cloud

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)?

Reviews

Write a Review

Operating System Questions & Answers

  Creating programs to compute

Compare zero-, one-, two-, and three-address machines through writing programs to compute X = (A+B X C)/D - E X F)

  A file system stores every file under a i-node

suppose a file system stores every file under a i-node similar to (but may not be the same as) the Unix V7 File System. The i-node contains 15 addresses, each address has 32 bits (4 bytes).

  Advantages of using smart cards for identification

Describe the advantages of using smart cards for identification and provide at least three examples.

  What is structured programming

What does it mean to say that a programming language is machine independent and name and describe four different programming paradigms.

  Consider a scenario of post mailbox there are two processes

consider a scenario of post mailbox there are two processes named sender s and receiver r. both processes can

  Switching elements in nxn banyan network

A stage of n x n banyan network consists of (n/2) 2x2 switching elements. 1st stage directs packets to the correct half of the network.

  Identify the costs associated with security requirement

A year after your 1st visit to credit union the manager calls you once again. His business is experiencing tremendous growth and requires to either open another branch office.

  The state of the waiting thread to blocked

Which IPC mechanism does not change the state of the waiting thread to blocked?

  Perspective of provisions of ebusiness services

Discuss and explain the different roles you might think be fulfilled through Web Services and Web Portals. What do you see as main distinctions between two from the perspective of provisions of eBusiness services?

  Creating pseudocode

Create pseudocode for the Citron Car rental policy, Standard transmission is available only for A, B, and C. Automatic transmission is available for all cars.

  Program of law of total probability

Think about a system that generates ten million audit records every day. Also suppose that there are on average 10 attacks per day on this system and that each such attack is reflected in twenty records.

  How many processes a computer can effectively support

Discuss the factors that you think would limit how many processes a computer can effectively support.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd