Question
CIS 162AD Case Problem 9-1: In previous chapters, you have created programs for the Greenville Idol competition. Now add a Contestant class with the following
CIS 162AD Case Problem 9-1:
In previous chapters, you have created programs for the Greenville Idol competition. Now add a Contestant class with the following characteristics:
The Contestant class contains public static arrays that hold talent codes and descriptions. Recall that the talent categories are Singing, Dancing, Musical instrument, and Other. Name these fields talentCodes and talentStrings respectively.
The class contains an auto-implemented property Name that holds a contestants name.
The class contains fields for a talent code (talentCode) and description (talent). The set accessor for the code assigns a code only if it is valid. Otherwise, it assigns I for Invalid. The talent description is a read-only property that is assigned a value when the code is set.
In order to prepend the $ to currency values, the program will need to use the CultureInfo.GetCultureInfo method. In order to do this, include the statement using System.Globalization; at the top of your program and format the output statements as follows: WriteLine("This is an example: {0}", value.ToString("C", CultureInfo.GetCultureInfo("en-US")));
Modify the GreenvilleRevenue program so that it uses the Contestant class and performs the following tasks:
The program prompts the user for the number of contestants in this years competition; the number must be between 0 and 30. The program continues to prompt the user until a valid value is entered.
The expected revenue is calculated and displayed. The revenue is $25 per contestant. For example if there were 3 contestants, the expected revenue would be displayed as:
Revenue expected this year is $75.00
The program prompts the user for names and talent codes for each contestant entered. Along with the prompt for a talent code, display a list of the valid categories. The categories should be displayed in the following format:
The types of talent are: S Singing D Dancing M Musical instrument O Other
After data entry is complete, the program displays the valid talent categories and then continuously prompts the user for talent codes and displays the names of all contestants in the category. Appropriate messages are displayed if the entered code is not a character or a valid code.
using System;
using static System.Console;
using System.Globalization;
class GreenvilleRevenue
{
static void Main()
{
// Your code here
}
}
I have the code correct but the output is still wrong. It says that there is an unexpected output of Jill, which is why it still comes out as wrong.
0.00 out of 10.00 Program produces correct output
0 out of 1 checks passed. Review the results below for more details.
Checks
Test CaseIncomplete
Program produces correct output
Input
2 Joey D Jill M D Z
Output
Enter the number of contestants in this year's competition (0 to 30): Revenue expected this year is $50.00 Enter the name of contestant 1: The types of talent are: S Singing D Dancing M Musical instrument O Other Talent codes are Joey Joey: Enter the name of contestant 2: The types of talent are: S Singing D Dancing M Musical instrument O Other Talent codes are Joey Jill:
Results
Revenue expected this year is $50.00
Talent codes are:
S Singing
D Dancing
M Musical instrument
O Other
Joey
Expected Output
Revenue expected this year is $50.00
Talent codes are:
S Singing
D Dancing
M Musical instrument
O Other
Joey
Unexpected Output
Jill
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