Question
Please write in C# Please don't copy the other answers they are wrong. Previously, you created a Contestant class for the Greenville Idol competition. The
Please write in C# Please don't copy the other answers they are wrong.
Previously, you created a Contestant class for the Greenville Idol competition. The class includes a contestants name, talent code, and talent description. The competition has become so popular that separate contests with differing entry fees have been established for children, teenagers, and adults.
Now, modify your program so the Contestant class contains the field Fee that holds the entry fee for each category, and add get and set accessors.
Extend the Contestant class to create three subclasses: ChildContestant, TeenContestant, and AdultContestant. Child contestants are 12 years old and younger, and their entry fee is $15. Teen contestants are between 13 and 17 years old, inclusive, and their entry fee is $20. Adult contestants are 18 years old and older, and their entry fee is $30.
In each subclass, set the entry fee field to the correct value, and override the ToString() method to return a string that includes all the contestant data, including the age category and the entry fee. For example, the output from ToString() should be displayed in the following format:
Child Contestant Joeph S Fee $15.00 Teen Contestant Sara M Fee $20.00 Adult Contestant Joy D Fee $30.00
Modify the GreenvilleRevenue program so that it performs the following tasks:
- The program prompts the user for the number of contestants in this years competition, which must be between 0 and 30. The program continues to prompt the user until a valid value is entered.
- The program prompts the user for the name, talent code, and age for each contestant. Along with the prompt for a talent code, display a list of valid categories. Based on the age entered for each contestant, create an object of the correct type (adult, teen, or child), and store it in an array of Contestant objects. Talent code categories should be displayed in the following format:
Talent codes are: S Singing D Dancing M Musical instrument O Other
- After data entry is complete, display the total expected revenue, which is the sum of the entry fees for the contestants. The total expected revenue should be displayed in the following format:
Revenue expected this year is $65.00
- After data entry is complete, display the valid talent categories and then continuously prompt the user for talent codes, and display all the data for all the contestants in each category (using the ToString method for each contestant). Display an appropriate message if the entered code is not a character or a valid code.
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