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
A type of touch screen that can be up to four feet by six feet is a(n) _____.
Llana [10]
Hi,

A type of touch screen that can be up to four feet by six feet is a(n) <span>multitouch interface.
</span>.
7 0
2 years ago
Read 2 more answers
A college student needs a laptop that can be used while committing on the train and sitting in a lecture
Westkost [7]
You could get a laptop for like 200 that could run well and enough space for stuff.
4 0
3 years ago
J=2
leonid [27]

Answer:

yup

tthast right

Explanation:

5 0
2 years ago
Which type of approach grew out of the development of computers, where even complex behavior such as learning, remembering, cate
mestny [16]

Answer:

In studies of technology and innovation, it is common to distinguish between different levels of technology. A common distinction is between technologies as processes or products and technology systems. Another distinction is between technology s hardware, software and orgware; sometimes socioware is added as yet another layer or category. In he studies, the focus is usually on a particular technology, either a process technology or product

Ž echnology with product technology broadly de In studies of technology and innovation, it is

common to distinguish between different levels of technology. A common distinction is between technologies as processes or products and technology. Another distinction is between technology as hardware, software and orgware; sometimes socioware is added as yet another layer or category. In the studies, the focus is usually on a particular technology, either a process technology or product.  

Explanation:

7 0
3 years ago
A computer retail store has 15 personal computers in stock. A buyer wants to purchase 3 of them. Unknown to either the retail st
Dima020 [189]

Answer:

a. 1365 ways

b. Probability = 0.4096

c. Probability = 0.5904

Explanation:

Given

PCs = 15

Purchase = 3

Solving (a): Ways to select 4 computers out of 15, we make use of Combination formula as follows;

^nC_r = \frac{n!}{(n-r)!r!}

Where n = 15\ and\ r = 4

^{15}C_4 = \frac{15!}{(15-4)!4!}

^{15}C_4 = \frac{15!}{11!4!}

^{15}C_4 = \frac{15 * 14 * 13 * 12 * 11!}{11! * 4 * 3 * 2 * 1}

^{15}C_4 = \frac{15 * 14 * 13 * 12}{4 * 3 * 2 * 1}

^{15}C_4 = \frac{32760}{24}

^{15}C_4 = 1365

<em>Hence, there are 1365 ways </em>

Solving (b): The probability that exactly 1 will be defective (from the selected 4)

First, we calculate the probability of a PC being defective (p) and probability of a PC not being defective (q)

<em>From the given parameters; 3 out of 15 is detective;</em>

So;

p = 3/15

p = 0.2

q = 1 - p

q = 1 - 0.2

q = 0.8

Solving further using binomial;

(p + q)^n = p^n + ^nC_1p^{n-1}q + ^nC_2p^{n-2}q^2 + .....+q^n

Where n = 4

For the probability that exactly 1 out of 4 will be defective, we make use of

Probability =  ^nC_3pq^3

Substitute 4 for n, 0.2 for p and 0.8 for q

Probability =  ^4C_3 * 0.2 * 0.8^3

Probability =  \frac{4!}{3!1!} * 0.2 * 0.8^3

Probability = 4 * 0.2 * 0.8^3

Probability = 0.4096

Solving (c): Probability that at least one is defective;

In probability, opposite probability sums to 1;

Hence;

<em>Probability that at least one is defective + Probability that at none is defective = 1</em>

Probability that none is defective is calculated as thus;

Probability =  q^n

Substitute 4 for n and 0.8 for q

Probability =  0.8^4

Probability = 0.4096

Substitute 0.4096 for Probability that at none is defective

Probability that at least one is defective + 0.4096= 1

Collect Like Terms

Probability = 1 - 0.4096

Probability = 0.5904

8 0
2 years ago
Other questions:
  • The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called a(n _
    14·1 answer
  • Small robots that can move around on the surface of a planet are called space shuttles.
    12·2 answers
  • Write a function called median, that takes as parameter a full, sorted array of doubles and returns the median of the list. For
    15·1 answer
  • Explicit knowledge can be documented and codified, whereas tacit knowledge encompasses insights, judgment, creative processes, a
    9·1 answer
  • ________________is a distribution of Linux Operating<br>system for desktop computers.<br>​
    15·1 answer
  • A local cinema allows customer to make a movie ticket reservation. A customer can be
    6·1 answer
  • ______ is a customer-facing CRM application.<br><br> FAQ<br><br> Search<br><br> SFA<br><br> E-mail
    6·1 answer
  • Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the cou
    8·1 answer
  • Using C++
    13·1 answer
  • Integrity! He talks to me of integrity! I described a circle in the air. I'd tried to build my integrity upon the role of Brothe
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!