subject

Now, modify the version of the greenvillerevenue program created in chapter 5 so that after the user enters the number of contestants in this year’s competition, the user is prompted for the appropriate number of contestant names and a code for each contestant that indicates the type of talent: s for singing d for dancing m for playing a musical instrument o for other. make sure that all entered codes are valid, and if not, reprompt the user to enter a correct code. for example, if y is input, output y is not a valid code, and reprompt the user until a valid code is entered. after contestant data entry is complete, display a count of each type of talent. for example, if there were ten singers, four dancers, 7 people who play musical instruments, and 1 in the other category, the output should be: contestants with talent musical instrument are: michellenick using system; using static system. console; class greenvillerevenue{ static void main() { const int entrance_fee = 25; const int min_contestants = 0; const int max_contestants = 30; string entrystring; int numthisyear; int numlastyear; int revenue; write("enter number of contestants last year > > "); entrystring = readline(); numlastyear = convert. toint32(entrystring); while(numlastyear < min_contestants || numlastyear > max_contestants) { writeline("number must be between {0} and {1}", min_contestants, max_contestants); write("enter number of contestants last year > > "); entrystring = readline(); numlastyear = convert. toint32(entrystring); } write("enter number of contestants this year > > "); entrystring = readline(); numthisyear = convert. toint32(entrystring); while(numthisyear < min_contestants || numthisyear > max_contestants) { writeline("number must be between {0} and {1}", min_contestants, max_contestants); write("enter number of contestants this year > > "); entrystring = readline(); numthisyear = convert. toint32(entrystring); } revenue = numthisyear * entrance_fee; writeline("last year's competition had {0} contestants, and this year's has {1} contestants", numlastyear, numthisyear); writeline("revenue expected this year is {0}", revenue. tostring("c")); if(numthisyear > 2 * numlastyear) writeline("the competition is more than twice as big this year! "); else if(numthisyear > numlastyear) writeline("the competition is bigger than ever! "); else if(numthisyear < numlastyear) writeline("a tighter race this year! come out and cast your vote! "); }}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
Write a program that uses a widgetviewer object to do the following: generate two random integers between 1 and 9 (inclusive). name one of them x, the other y. display them to the user using jlabel objects. create a jlabel object displaying the text "enter an operation number." create a jtextfield for the user's input. create a jbutton displaying the text "press here when you've entered your operation." use addandwait to add it to the widgetviewer object. when the user clicks the jbutton, evaluate operation in the following order to determine the one and only mathematical operation to perform on x and y. use a jlabel to display the result. if operation is between 1 and 10 inclusive, add x and y. if operation is evenly divisible by 4, subtract y from x. if operation is evenly divisible by 5, use integer division to divide y into x. if operation is an even number, use floating point division to divide y into x. if none of the other tests on operation apply, multiply x and y. note: operation can be negative or zero.
Answers: 2
question
Computers and Technology, 22.06.2019 07:30
What type of computer network ensures high security ?
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Complete the sentence about a presentation delivery method
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
You know the right answer?
Now, modify the version of the greenvillerevenue program created in chapter 5 so that after the user...
Questions
question
Mathematics, 26.03.2021 01:00
question
Mathematics, 26.03.2021 01:00
Questions on the website: 13722367