Question: C + + Case problem 1 0 . 1 Previously , you created a Contestant class for the Greenville Idol competition. The class includes a
C Case problem 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 Feethat holds the entry fee for each category, and add get and setaccessors.
Extend the Contestant class to create three subclasses: ChildContestant, TeenContestant, and AdultContestant. Child contestants are years old and younger, and their entry fee is $ Teen contestants are between and years old, inclusive, and their entry fee is $ Adult contestants are years old and older, and their entry fee is $
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 $ Teen Contestant Sara M Fee $ Adult Contestant Joy D Fee $
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: WriteLineThis is an example: value.ToStringC CultureInfo.GetCultureInfoenUS;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
