Question
Help fix the lines of code: GreenvilleRevenue.cs(128,246): error CS1525: Unexpected symbol `end-of-file' Compilation failed: 1 error(s), 0 warnings Cannot open assembly 'GreenvilleRevenue.exe': No such file
Help fix the lines of code:
GreenvilleRevenue.cs(128,246): error CS1525: Unexpected symbol `end-of-file' Compilation failed: 1 error(s), 0 warnings Cannot open assembly 'GreenvilleRevenue.exe': No such file or directory.
using System;
using static System.Console;
using System.Globalization;
class GreenvilleRevenue
{
static void Main()
{
int contestantThisYear = 0;
int contestantLastYear = 0;
string input;
// get contestant number of this year
WriteLine("Enter the number of contestants for this year:");
input = ReadLine();
while (!int.TryParse(input, out contestantThisYear) || contestantThisYear < 0)
{
WriteLine("Invalid input. Enter a positive integer value:");
input = ReadLine();
}
// get contestant number of last year
WriteLine("Enter the number of contestants for last year:");
input = ReadLine();
while (!int.TryParse(input, out contestantLastYear) || contestantLastYear < 0)
{
WriteLine("Invalid input. Enter a positive integer value:");
input = ReadLine();
}
// display relationship
DisplayRelationship(contestantThisYear, contestantLastYear);
// get contestants' data
string[] names = new string[contestantThisYear];
char[] talents = new char[contestantThisYear];
char[] talentCodes = new char[contestantThisYear];
string[] talentCodesStrings = new string[] { "Vocal", "Dance", "Instrument", "Theater" };
int[] counts = new int[4];
GetContestantData(contestantThisYear, names, talents, talentCodes, talentCodesStrings, counts);
// get lists
GetLists(contestantThisYear, talentCodes, talentCodesStrings, names, talents, counts);
}
public static int GetContestantNumber(string when, int min, int max)
{
// Write your GetContestantNumber() here.
}
public static void DisplayRelationship(int numThisYear, int numLastYear)
{
WriteLine("This years contest has " + (numThisYear < numLastYear ? "fewer" :
numThisYear == numLastYear ? "the same" : "more") +
" contestants than last years.");
}
public static void GetContestantData(int numThisYear, string[] names, char[] talents, char[] talentCodes, string[] talentCodesStrings, int[] counts)
{
for (int i = 0; i < numThisYear; i++)
{
WriteLine("Enter the name of contestant " + (i + 1) + ":");
names[i] = ReadLine();
bool validInput = false;
while (!validInput)
{
Write("Enter the talent code (V, D, I, T) of contestant " + (i + 1) + ": ");
string talentInput = ReadLine();
if (talentInput.Length != 1)
{
WriteLine("Invalid format - entry must be a single character");
}
else if (!char.TryParse(talentInput, out talents[i]))
{
WriteLine("Invalid input - please enter a single character");
}
else if (Array.IndexOf(talentCodes, talents[i]) != -1)
{
WriteLine("That talent code has already been used. Please try again");
}
else if (!"VDIT".Contains(talents[i].ToString().ToUpper()))
{
WriteLine("That is not a valid code");
}
else
{
talentCodes[i] = talents[i];
validInput = true;
}
}
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started