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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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