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 1–2 sentences describe the purpose of comparison operators and give an example.
love history [14]
Comparison operators are used to compare between objects!
are they equal?  is one greater than the other?

if (a == b) ++a;
if (a > b) a = b;

for example when we use a sort function, comparison operators are used inside the function.

7 0
3 years ago
Patricia's partner Alex has shared a spreadsheet he created. On the first row he has given the spreadsheet a title. The title ap
Alexxandr [17]

Answer:

Merge cells A1:E1 and centre the title text in the merged cell.

Explanation:

In order for the title of the shared spreadsheet document to appear centred in the first row above the other five columns, Patricia will be required to merge the first row A1 with the fifth row E1 and centre the title text in the merged cells. This increases the number of rows  and columns of the spreadsheet as the information in the other cells will be shifted down.

3 0
3 years ago
. Each year over _____ tires are scrapped in the United States alone.
gregori [183]

290 is the number i found, So i would assume "C" is correct.

4 0
4 years ago
Read 2 more answers
4. What is the difference between portrait orientation and landscape orientation? (1.0 points)
Bezzdna [24]

Answer:

Portrait orientation is taller then it is wide, while landscape orientation is wider then it is tall.

Explanation:

3 0
4 years ago
Which of the following is not a type of user account? A. Administrator b. Guest c. Group d. Standard
Arlecino [84]
I've never heard of a group account so I'm going with.
C. Group
5 0
4 years ago
Other questions:
  • Use the following business rules to assign name to the tables on the ERD: Note: These rules are in the context of a small retail
    7·1 answer
  • The highly advanced decision support feature integrated within an electronic information system would support which activity?
    9·1 answer
  • When superiors providedirections to their subordinates regarding what to do, thisis
    5·1 answer
  • In the accompanying figure, the split double arrow mouse pointer____.
    7·1 answer
  • Which can be used to plan a program?
    13·2 answers
  • What type of media is a hard disk​
    9·1 answer
  • Term of The surroundings and conditions of your workplace
    6·1 answer
  • Write its features:features of computer ​
    15·1 answer
  • This feature allows you to adjust your view to see the lower and upper part of a document
    15·2 answers
  • Write a short essay about the best rotary-wing aircraft ever. It must be a specific aircraft and consist of three paragraphs. In
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!