subject

Write the following static methods. assume the reference variable input for the scanner class and any global variables mentioned are already declared. use printf.

a. a method called tickets() that prompts for the number of tickets to be purchased and stores it in a global variable called nooftickets. think about the data type.

b. overload the method coded in 1a above so that it accepts the number of tickets and the price for a ticket through its parameter list, and returns the cost for the ticket(s). no prompts are needed.

c. a value-receiving method that accepts the cost for a ticket purchase and adds it to a global variable called monthlyfun.

d. a method that accepts yearlyfun and yearlyfunbudget through its parameter list and tests to see if yearlyfun is over-budget, under-budget, or on-budget. if it is over-budget return the message "way too much fun! over-budget! "; under-budget return "little more fun! under-budget! "; and on-budget "just the right fun! " on-budget! ". no prompts are needed.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:30, yeeet26
If an improvement creates no significant change in a product’s performance, then it is a(n) ? a0 design improvement. (there are no answer choices)
Answers: 1
image
Computers and Technology, 22.06.2019 19:10, kaiya789
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
image
Computers and Technology, 22.06.2019 22:30, MoneyMike42
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
image
Computers and Technology, 22.06.2019 22:50, youngboymark123
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
You know the right answer?
Write the following static methods. assume the reference variable input for the scanner class and an...

Questions in other subjects: