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

  Identity top level objects of the microwave

Construct a table with the following four column headings, Top Level Objects, Communicates With, Incoming Messages, and Outgoing Messages and Identity top level objects of the microwave.

  Question 1athe salaries of employees of a firm are found to

question 1athe salaries of employees of a firm are found to be follow a normal distribution of mean rs 13 500 and

  Operating systems that can be used in health care delivery

Discuss at least 2 operating systems that can be used in health care delivery. Your discussion should include descriptions of at least 2 operating systems such as, but not limited to, the following: Windows and Unix

  Maintaining network configuration

In a Windows 2003 server network discuss various devices such as: repeaters, routers and gateways. Detemrine the functions for those devices? At which layer of the OSI model do those devices operate?

  Shell to be able to execute the most recent command

shell to be able to execute the most recent command and also be able to execute a specified command from the history.  the printHistory function

  Give three technical merits of unix

Give three technical merits of UNIX b) Differentiate between "clustered systems" and "real-time systems". c) Describe the purpose of using "trust relationship"

  What are the advantages of using dynamic loading

Briefly describe the segmentation memory management scheme. How does it differ from the paging memory management scheme in terms of the user's view of memory - What are the advantages of using dynamic loading?

  Draw the file hierarchy of my apex cartons folder

I open my computer and create a new folders named Apex Carton, Manufacturing, Material Suppliers, East Coast and West Coast. Then move the East Coast and West Coast folders into the Material Suppliers folder.

  Compare two operating system

Find a friend, relative, or co-worker with a computer that uses an operating system that you don't usually use (Windows, Mac OS, or Linux). Try out the operating system, and observe how it works compared with the operating system that you normally..

  How are shared memory message passing rpc and sockets

How are shared memory, message passing, RPC, sockets, and pipes implemented practically in systems such as POSIX, Mach, and Windows?

  Preparing for a company-wide migration to windows 8

Preparing for a Company-Wide Migration to Windows 8

  Explain decision variables in relation to linear programming

Explain the following terms in relation to linear programming problems- (1) decision variables (2) objective function

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