Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXLab 12 Lab 12 – Reference Parameters In this lab you will continue to practice writing functions. In addition to writing functions with...

1 answer below »
CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXLab 12

Lab 12 – Reference Parameters
In this lab you will continue to practice writing functions. In addition to writing functions with value
parameters (as you did in the previous lab), you will write functions with reference parameters. You will
use reference parameters to pass more than one value back to the calling function.
Your Program
You will complete a program that calculates a contestant's score based on the scores from five judges.
The highest and lowest of the judges' scores are thrown out, and the contestant's score is the average of
the remaining three judges' scores.
I have already written the main function for you, and the function to get user input (provided in the
AverageScore.cs file). You should not make any modifications to the Main function, or to the
getDouble0to10 function. You will write two additional functions, as specified in the comments in the
file. Note that the functions you write must match the calls to those functions from the main program.
You may not use global variables. You will turn in the completed .cs file.
The output from your program should look similar to the sample output below.
Challenge
For the challenge this week, put the two methods you must write in a separate class, instead of defining
them as static methods in the AverageScore class. This will require you to modify the Main function a
little bit, in order to grant access to those methods.
Sample Output
CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXLab 12
Answered Same Day Jul 18, 2021

Solution

Aditya answered on Jul 19 2021
128 Votes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace AverageScore
{
class Program
{
static void Main(string[] args)
{
double score1, score2, score3, score4, score5;
The judges' scores
double avg;
The average scores excluding maximum and minimum

Print the welcome message
Console.WriteLine("This program calculates the contestant's score based on ");
Console.WriteLine("scores from 5 judges. The highest and lowest scores are dropped.");

Get the judges' scores from console input
score1 = getDouble0to10("Score from judge 1: ");
Console.Write("\n");
score2 = getDouble0to10("Score from judge 2: ");
Console.Write("\n");
score3 = getDouble0to10("Score from judge 3: ");
Console.Write("\n");
score4 = getDouble0to10("Score from judge 4: ");
Console.Write("\n");
score5 = getDouble0to10("Score from judge 5: ");

creating class object
Calculations obj = new Calculations();

Find the average with the maximum and minimum scores dropped using class
avg = obj.avg5MinusMaxMin(score1, score2, score3, score4, score5);

Print the average to console output
Console.WriteLine("\nThe contestant's score is: {0}",...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here