Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# coding: The code needs to be in this one C# code. I am doing this in Cengage which runs tasks/ checks to make sure

C# coding:

The code needs to be in this one C# code. I am doing this in Cengage which runs tasks/ checks to make sure the code is coded the way it wants you to. I have included all of that.

instructions:

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.

Tasks:

1. Contestant class defined. Contestant class contains talent arrays. Contestant class contains Name property. Contestant class contains contestant's talent code and description.

2.Program produces correct output.

INPUT:

2 Joey D Jill M D Z

EXPECTED OUPUT:

Revenue expected this year is $50.00

Talent codes are:

S Singing

D Dancing

M Musical instrument

O Other

Joey

Starter code: GreenvilleRevenue.cs:

using System;

using static System.Console;

using System.Globalization;

class GreenvilleRevenue

{

static void Main()

{

// Your code here

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

i NEED GRAPHS & ABOVE SOLUTION IS NOT WORKING GIVING ERROR

Answered: 1 week ago