Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Our teacher wants us to use a class and a driver class for this problem. Band Booster Class In this exercise, you will write a
Our teacher wants us to use a class and a driver class for this problem. Band Booster Class In this exercise, you will write a class that models a band booster and use your class to update sales of band candy. . Write the BandBooster class assuming a band booster object is described by two pieces of instanced name (a String) and boxes Sold (an integer that represents the number of boxes of band candy the booster has sold in the band fundraiser). The class should have the following methods: A constructor that has one parameter -a String containing the name of the band booster. The constructor should set boxesSold to 0 A method getName that returns the name of the band booster (it has no parameters). A method update Sales that takes a single integer parameter representing the number of additional boxes of candy sold. The method should add this number to boxesSold.int prveintbores A toString method that returns a string containing the name of the band booster and the number of boxes of candy sold in a format similar to the following: Joe: 16 boxes Write a program that uses BandBooster objects to track the sales of 2 band boosters over 3 weeks. Your program should do the following: Read in the names of the two band boosters and construct an object for each. Prompt for and read in the number of boxes sold by each booster for each of the three weeks. Your prompts should include the booster's name as stored in the BandBooster object. For example, Bnter, the nunpey of boxes sold by doe this veek For each member, after reading in the weekly sales, invoke the updateSales method to update the total sales by that member. After reading the data, print the name and total sales for each member (you will implicitly use the toString method here)
Our teacher wants us to use a class and a driver class for this problem.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started