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

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
What computer network component allows data transfers from one computer to another through a telephone line?
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Jennifer has to set up a network in a factory with an environment that has a lot of electrical interference. which cable would she prefer to use? jennifer would prefer to use because its metal sheath reduces interference.
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
You know the right answer?
You created an interactive application named GreenvilleRevenue. The program prompts a user for the n...
Questions
question
Mathematics, 26.02.2021 02:20
question
Mathematics, 26.02.2021 02:20
question
Chemistry, 26.02.2021 02:20
Questions on the website: 13722366