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

  Question about data communications

A 4480 octet datagram is to be transmitted and requires to be fragmented because it will pass through an Ethernet with a maximum payload of 1500 octets.

  Discuss the purpose of operating systems

Discuss the purpose of operating systems and Describe the components that comprise operating systems and the functions of each of these components

  Wireless encryption standards

Compare the several wireless encryption standards. Determine the purpose of implementing wireless encryption and discuss the benefits of each standard?

  How would you transform the ptp to jsp

Packet Transmission Problem (PTP) and Job Scheduling Problems (JSP) are known NP-complete problems. How would you transform the PTP to JSP

  Describe a simple rule for determining a particular request

Describe a simple rule for determining whether a particular request can be satisfied without causing deadlock given the current allocation of chopsticks to philosophers.

  Implement a program to simulate the operation

Design and implement a program to simulate the operation of the SIMMAC - define the notion of an interrupt handler that will process a time quantum for ea ch running job.

  Assignment on single instruction multiple data instructions

Discuss what is meant by single-instruction multiple-data instructions. How are these instructions used?

  Minimum and maximum size of an ethernet frame in bytes

Determine the minimum size and Maximum size of an Ethernet frame, in bytes?

  Show the output of the screen when the program executes

Show the output of the screen when the program executes with a value of 200.

  How long would it take to run the jobs consecutively

How long would it take to run the jobs consecutively in batch mode and How would this improve if multiprogramming was allowed?

  Fragmentation on a storage device

Fragmentation on a storage device could be eliminated by re-compaction of the information. Typical disk devices do not have relocation or base registers (such as are used when memory is to be compacted)

  Solving computer networking problem

Nichol's network technicians says she does not believe the servers are capable of handling Windows Server 2008. Describe what components she will require to add or upgrade, at minimum, to make Nichol's servers capable of running Windows Server 2008.

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