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, 23.06.2019 02:00
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
Answers: 1
question
Computers and Technology, 24.06.2019 03:40
4. does the kernel phenotype distribution support the idea that the cob is the result of a dihybrid cross? what information supports your answer? if a dihybrid cross (i.e. f1 to f2 of standard mendelian crosses) is not indicated what conditions might contribute to this finding.
Answers: 2
question
Computers and Technology, 24.06.2019 23:00
Hypertension occurs when blood pressure is too high.
Answers: 1
You know the right answer?
You created an interactive application named GreenvilleRevenue. The program prompts a user for the n...
Questions
question
English, 13.03.2020 05:48
Questions on the website: 13722363