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();
}
}
The program in this code is written correctly and has the messages applied in the code. Therefore, the only thing that would need to be done is pass the correct integers in the code. If you pass the integer 100 contestants for last year and 300 for current year. Then these inputs will provide the following output as requested in the question.
The competition is more than twice as big this year!
This is because the current year would be greater than double last years (100 * 2 = 200)
Aaron's action is considered legal, as you are allowed to make a backup copy of a legal copy of a software, but it can only be used in case the original software is destroyed or unusable.
The correct answer to the following question will be "PRAM needs to be reset".
Explanation:
<u>PRAM:</u>
It is commonly known as "Parameter Random Access Memory". It is a memory that is used to store the settings of the system of a Mac OS. These settings comprise of monitor settings, speaking settings, WI-FI settings, etc.
So, according to the given case when the WI-FI icon shows that the system is connected to the internet but he is not able to browse the internet. In this case, he needs to reset the PRAM to browse the internet.
In applying for a license, students must take the knowledge test online or in the licensing office. However, the exams do not stop there, they also need to test the skills test or a drive test after passing the knowledge test. This is to complete their application for a driver's license.