1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Gwar [14]
3 years ago
9

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();
}
}
Computers and Technology
1 answer:
Korolek [52]3 years ago
4 0

Answer:

Explanation:

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)

You might be interested in
In which conditions, a trial balance does not tally?
Nostrana [21]

Answer:

A trial balance will not balance if both sides do not equal, and the reason has to be explored and corrected.

Explanation:

The debit side and the credit side must balance, meaning the value of the debits should equal the value of the credit

4 0
2 years ago
Olivia wants to change some settings in Outlook. What are the steps she will use to get to that function? open Outlook → File →
Rainbow [258]

Answer:

C.

Explanation:

edg 2020

3 0
2 years ago
Read 2 more answers
To keep you from inadvertently moving controls as you work in the IDE, click the form or control, then click the _________ optio
Alenkinab [10]

Answer:

Lock controls

Explanation:

4 0
3 years ago
Identify an advantage of working in teams.
ra1l [238]

If you're on apex and you have the answer choice

A: Less wasted time

B: Less skills

C: Strong work ethics

D: More ideas

Then D is the answer

7 0
2 years ago
What is stored in alpha after the following code executes?
Andreas93 [3]

Answer:

3. alpha = {1, 5, 6, 7, 5}

Explanation:

Initially, we have that:

alpha[0] = 1;

alpha[1] = 2;

alpha[2] = 3;

alpha[3] = 4;

alpha[4] = 5;

For j higher than 2, we have that:

alpha[j - 1] = alpha[j] + 2;

So

j = 3

a[2] = alpha[3]+2 = 4 + 2 = 6;

j = 4

a[3] = alpha[4]+2 = 5+2 = 7;

The correct answer is:

3. alpha = {1, 5, 6, 7, 5}

6 0
2 years ago
Other questions:
  • Queue is the LIFO structure.<br><br> o True<br><br> o False
    8·1 answer
  • Using the syntax in section 2.3, write a command delete_all_rights (p, q, s). this command causes p to delete all rights the sub
    13·1 answer
  • ____________________ is the premeditated, politically motivated attacks against information, computer systems, computer programs
    6·2 answers
  • If we have a priority queue storing approximately million numbers, and the bottom level is "full", which of the following statem
    9·1 answer
  • How has technology affected the way that you produce art like photographs?
    8·1 answer
  • assume an int array, candy, stores the number of candy bars sold by a group of children wherecandy[j] is the number of candy bar
    7·2 answers
  • A tornado destroyed many
    6·2 answers
  • What are some qualities of a good game critic? What are some qualities of a bad game critic?
    7·1 answer
  • Which of the following digital communicatio media does not require a connection to the internet
    11·1 answer
  • Identify three errors in this HTML code snippet:
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!