subject

You created an interactive application named GreenvilleRevenue. The program prompts a user for the number of contestants entered in this year’s and last year’s Greenville Idol competition, and then it displays the revenue expected for this year’s competition if each contestant pays a $25 entrance fee. The programs also display a statement that compares the number of contestants each year. Using the program you wrote in Case Study 1 of Chapter 2, replace that statement with one of the following messages:. If the competition has more than twice as many contestants as last year, display The competition is more than twice as big this year!
If the competition is bigger than last year’s but not more than twice as big, display The competition is bigger than ever!
If the competition is smaller than last year’s, display, A tighter race this year! Come out and cast your vote!
Grading
When you have completed your program, click the Submit button to record your score.
Code:
using System;
using static System. Console;
class GreenvilleRevenue
{
static void Main()
{
int last, curr;
while(true) {
Console. WriteLine("Enter the number of contestants entered in last year's competition : ");
last = Int32.Parse(Console. ReadLine());
if(last < 0 || last > 30) {
Console. WriteLine("Error. Please enter a value between 0 and 30.");
} else {
break;
}
}
while(true) {
Console. WriteLine("Enter the number of contestants entered in this year's competition : ");
curr = Int32.Parse(Console. ReadLine());
if(curr < 0 || curr > 30) {
Console. WriteLine("Error. Please enter a value between 0 and 30.");
} else {
break;
}
}
if((last >= 0) && (last <= 30) && (curr >= 0) && (curr <= 30))
Console. WriteLine("The revenue expected for this year's competition : $" + curr * 25 + '\n');
if (curr > last * 2)
Console. WriteLine("The competition is more than twice as big this year!\n");
else
if (curr > last && curr <= (last * 2))
Console. WriteLine("The competition is bigger than ever!\n");
else
if (curr < last)
Console. WriteLine("A tighter race this year! Come out and cast your vote!\n");
else
Console. WriteLine("Please enter a valid value\n");
Console. ReadLine();
}
}

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:30, lilpeepxliltracy
This technology is used to produce high-quality documents that look good on the computer screen and in print.
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, hailey5campbelp7d1c0
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, gabby640
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
image
Computers and Technology, 24.06.2019 05:50, 11232003
What all vehicles has tesla inc. created over the years
Answers: 3
You know the right answer?
You created an interactive application named GreenvilleRevenue. The program prompts a user for the n...

Questions in other subjects:

Konu
Mathematics, 07.01.2021 22:10
Konu
Arts, 07.01.2021 22:10
Konu
Mathematics, 07.01.2021 22:10
Konu
Mathematics, 07.01.2021 22:10
Konu
Mathematics, 07.01.2021 22:10
Konu
History, 07.01.2021 22:10