C Sharp case Problem 2-1 In Chapter 1, you created two programs to display the motto for the Greenville Idol competition that is held each summer during the Greenville County Fair. Now write a program named GreenvilleRevenue that prompts a user for the number of contestants entered in last year’s competition and in this year’s competition. Display all the input data. Compute and display the revenue expected for this year’s competition if each contestant pays a $25 entrance fee. Also display a statement that indicates whether this year’s competition has more contestants than last year’s.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
C Sharp case Problem 2-1
In Chapter 1, you created two programs to display the motto for the Greenville Idol competition that is held each summer during the Greenville County Fair.
Now write a
- Display all the input data.
- Compute and display the revenue expected for this year’s competition if each contestant pays a $25 entrance fee.
- Also display a statement that indicates whether this year’s competition has more contestants than last year’s.
C# Program is given below -
This program takes input from the user. The input is not validated as this is not mentioned in the question.
- An integer variable is declared and initialized by the fees of this year’s competition.
- Integer variables are declared to store participants for last year, present year and revenue earned in the present year.
- User enters the number of participants in last year’s competition.
- User enters the number of participants in this year’s competition.
- All the input from the user is displayed.
- The revenue earned in this year’s competition is computed and displayed.
- The message is also displayed whether number of participants this year is greater or not than the last year.
- Also, if participants are same in both years, the message is displayed accordingly.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images