How many contestants are in the file

Assignment Help Programming Languages
Reference no: EM131308491

Assignment

A talent competition has 5 judges, each of whom awards a score

Resolved Question:

A 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. Write a program that uses this method to calculate a contestant's score. It should include the following functions:

void getJudgeData() -- This should ask the user for a judge's score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of the 5 judges.

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

The last two functions, described below, should be called by calcScore, which uses the returned information to determine which of the scores to drop.

int findLowest() -- This should find and return the lowest of the 5 scores passed to it.

int findHighest() -- This should find and return the highest of the 5 scores passed to it.

Finally, Input Validation: Do not accept judge scores lower than 0 or higher than 10.

Your task is to create a modified version of the Star Search program (Chapter 6 problem #11). To understand the modifications use the following instructions:

1. Read the current Star Search program statement

2. Add the following specifications to the Star Search program description

Your program will have an input file that will consist of a list of contestants. The first line of the file is an integer that says how many contestants are in the file. Each line is for one contestant and each line in the file would have the following format (the name of the input file starsearch.dat):

Contestant Name(no spaces) score1 score2 score3 score4 score5

Your program will have a function called string contestantName() that takes the file object as a reference parameter and reads the file for the name of the contestant on the current line and returns the name. This function should be called from main, once for each line of the file.

The void getJudgeData() will read from the file and not from the user. This function will still use a reference parameter for the score, and it will read the next score from the file. This function will be called five times per contestant and is called from main once for each score.

The void CalcScore() is used to calculate the score using the same formulation. However, this function will write the contestants name and score to an output file. The function will have 7 parameters instead of 5: output file (pass by reference), contestants' name, and the 5 judges scores.

Error in the books specification: findLowest() and findHighest() should return double and not int.

Note: You are not allowed to use arrays

The output file will be a list of contestants, where each line has the following format (name the output file results.dat):

Contestant Name(name contains no spaces) Final_Score

In summary, the program is the same as the original version with the additional features: input file, output file, and more than one contestant. This causes the changes in the functions for input and output. The findLowest and findHighest functions are still needed as stated in the original description.

SAMPLE INPUT FILE

2

Jennifer 10 9 8 9.5 10

Michael 10 9 10 9 10

SAMPLE OUTPUT FILE

Jennifer 9.50

Michael 9.67

Reference no: EM131308491

Questions Cloud

Write a dim statement that declares a myfriend variable name : Write a Dim statement that declares a MyFriend variable named school. Write an assignment statement that assigns the value in the txtFirst control to the strFirst member.
Why should they be put in place : What basic principle of constitutional law must a police officer, but not always a probation officer, follow when conducting an ethical and legal search of a probationer's house? Explain why this law is applicable to this situation.
What is a sentinel event : What is a sentinel event? How is it processed in a healthcare organization? Please state citations.
Does this mean that two separate tcp connections are created : FTP uses two separate well-known port numbers for control and data connection. Does this mean that two separate TCP connections are created for exchanging control information and data?
How many contestants are in the file : Your program will have an input file that will consist of a list of contestants. The first line of the file is an integer that says how many contestants are in the file.
Research on a recent threat or attack on a government agency : Conduct research on a recent threat or attack on a government agency, military organization, or corporate enterprise. Present data that describes the type of threat, the degree of harm caused by the threat, and describe who or what entity the perp..
Monitoring and evaluation : Effective health care organizations recognize the importance of monitoring the implementation of a strategy as well as ongoing operations. These organizations plan ahead to ensure that appropriate measures are in place for evaluation purposes. For..
Explain the opportunities for improving distribution : Explain the opportunities for improving distribution and logistics functions, and explain the challenges of transportation and logistics in supply chain management.
Why is it an important technology today s society : Your poster should examine the important scientific aspects of your topic for an academic audience. Why is it an important technology today s society? What impact is this technology having on society or healthcare

Reviews

Write a Review

Programming Languages Questions & Answers

  Explain a work place program designed to help participants

Write down four one-sentence goals for program. Each of the four goals shold associate to successful program completion and must promote one specific health behavior.

  Write program to calculate student-s quiz average

Write a program that will calculate a student's quiz average. The program should prompt the user for the number of quizzes and then ask the user for each quiz grade.

  Javascript for metric conversions

Write a javascript that will assist the user with metric conversions. Your program should allow the user to specify the names of the units as strings.

  Compute the product xy

Given two integers X and Y compute the product XY (multiplication), the quotient X=Y (integer division), and the modulus X (mod Y) (remainder).

  Software package that requires user to enter thei password

Write a C++ program that asks for a password and then verifies that it meets the stated criteria. If it does not, the program should display a message telling the user why.

  Write program to caculate value of user-s stock

Write a program which caculates value of user's holding of a particular stock. Program asks for number of shares held, whole ¬dollar portion of price for one share, also the fraction portion.

  Display the gross earnings-tax payable using program

Print the gross earnings, tax payable, medical levy and net earnings for each employee. At the end of report, print total gross earnings, total tax, total medical levy and total net earnings.

  All variables that aren''t numeric variables

All variables that aren't numeric variables

  Programming concepts

The assignment problem is straightforward. All necessary details have been supplied. The solution of the problem will be straight line code which will use the programming concepts and strategies covered in Workshops 1-3. The subgoals are:

  Create a math program to practice math skills

Creating a Math Program to practice Math Skills. Ask the user what type of math problem they would like (addition, subtraction, multiplication, division, modulas).

  Write script in fedora to automate complex system task

Write a script in fedora 10 that will automate a complex system task. The task I have chose is one that will determine the processes that are consuming system resources.

  Write a program that reads the coordinates

Write a program that reads the (x,y) coordinates of a point in the Cartesian plane and prints a message telling in which quadrant, or on which axis (or axes) the point lies. The quadrants are labeled as follows:

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