Java Class: Fundraiser You are a fundraising distributor who needs to to pre-sell a limited number of doughnut coupon books. Each buyer can buy as many as 4 coupon books. No more than 100 coupon books can be sold. Implement a program called Fundraiser that prompts the user for the desired number of coupon books and then displays the number of remaining coupon books. Repeat until all coupon books have been sold, and then display the total number of buyers.
Java
Class: Fundraiser
You are a fundraising distributor who needs to to pre-sell a limited number of doughnut coupon books. Each buyer can buy as many as 4 coupon books. No more than 100 coupon books can be sold. Implement a
A java program is defined as a class with a main function defined inside the class. The main program may be used to enter data, calculate, and output data.
A scanner class is used to input data from keyboard for the number of coupon books requested. Validations are done to ensure the requested number is within the acceptable range. A variable maintains the current count of coupons available. It is decremented everytime a request for coupon books is processed.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps