473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How should this program be written in DEV C++?

A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer's final score is determined by dropping the highest and lowest score received, then averaging the 3 remaining scores. Flowchart and write a program that uses this method to calculate a contestants score. It should include the following functions:

void getJudgeData(...)
should ask the users for a judge's score, store it in a reference variable, and validate it. This function should be called by main once for each of the five judges. Do not accept scores less than 0 or higher than 10.

void calcScore(...)
should calculate and display the average of 3 scores that remain after drooping the highest and the lowest scores the performer received. This function should be called by main just once, and should be passed the 5 scores.

int findLowest(.. )
should find and return the lowest of five scores passed to it. Called by calcScore.

int findHighest(.. )
should find and return the highest of five scores passed to it. Called by calcScore.
Jul 23 '07 #1
2 4803
Heres what I have

#include <iostream>
using namespace std;

void getJudgeData(double &, int );
void calcScore(double, double, double, double, double);
double findLowest(double, double, double, double, double );
double findHighest(double, double, double, double, double );
double score;
int judge;


int main()

{

double judge1;
double judge2;
double judge3;
double judge4;
double judge5;

getJudgeData(judge1,1);
getJudgeData(judge2,2);
getJudgeData(judge3,3);
getJudgeData(judge4,4);
getJudgeData(judge5,5);

calcScore(judge1, judge2, judge3, judge4, judge5);
system ("pause")
return 0;
}



void getJudgeData(double &score, int x)
{

cout <<"Please enter Judge " << x <<"'s score:\n";
cin >> score;

while (score < 0 || score > 10)
{
cout << "Score must be between 0 and 10. Please enter a score in that range:\n";
cin >> score;

}

}


double findLowest(double s1, double s2, double s3, double s4, double s5)
{
double lowest;



return lowest;

}



double findHighest (double s1, double s2, double s3, double s4, double s5)
{
double highest;


return highest;

{

void calcScore();
double avgScore
avgScore = (total - highest - lowest) / 3;
cout << "The average score is "<< aveScore << endl;

}
Jul 23 '07 #2
For future reference try to use the code tags it makes things much easier to use. Its the # in the toolbar.

As for your project, a good start. As is the policy here we cannot do everything for you but I can give a few pointers.

First, the scores are 1-10 so maybe use int instead of double.

Second I would store the data in a 2-dimensioned array. One dimension for the judge and one for the contestant. This makes passing the data around easier and then you can setup some simple loops in the calc. Otherwise as you have seen your lowest/highest code is difficult because it would be a huge if/else thing.
Jul 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: anuradha.k.r | last post by:
hi, i am writing a socket program in python,both client side and server side.I've written the client side which is working perfectly fine(checked it against server program written in C).but as for...
50
by: strutsng | last post by:
I want if "a C program is a standard C++ program, but not vice versa" is a correct statement? In a C++ program, we can use standard C libraries. However, we cannot use C++ libraries inside C...
7
by: James | last post by:
Hi, Recently my boss has given me a huge program (10000) lines of code. The program has be written in an unmaintainable fashion. It looks like someone who did not know programming has written...
5
by: tindog | last post by:
I seem to be caught in a bit of a conundrum with C#. First of all getting books on VS 2003.net then VS 2005 comes out and further a book I have bought to just learn just the language C# (in 21...
11
by: Eliot Coweye | last post by:
According to Einstein, objects of great mass affect timespace. Can a great mass of bits in a badly written C++ program affect timespace, making the harddisk were it is written on incredibly slow...
83
by: deppy_3 | last post by:
Hi.I am started learning Programm language C before some time.I am trying to make a programm about a very simple "sell shop".This programm hasn't got any compile problem but when i run it i face...
4
by: switzerland qunatium computer | last post by:
Machine intelligence- can this program be written ?? Machine intelligence- can this program be written ??
6
by: Howard | last post by:
Just curious What is the largest program you have written in terms of source code length and complexity? Howard
28
by: gnuist006 | last post by:
I have some code like this: (if (test) (exit) (do something)) or (if (test)
2
by: Manikandan | last post by:
Hi, I have a program written in .Net Framework 1.1 using Visual studio enterprise edition 2003. I tried compiling the same program in visual c# express edition 2005. I'm getting following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.