subject
Computers and Technology, 09.07.2020 01:01 3mina

In this exercise, you will write a class that models a band booster and use your class to update sales of band candy. 1. Write the BandBooster class assuming a band booster object is described by two pieces of instance data: name (a String) and boxesSold (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 updateSales that takes a single integer parameter representing the number of additional boxes of candy sold. The method should add this number to boxesSold.
• 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
2. 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,
Enter the number of boxes sold by Joe this week:
• 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).

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:30
Active listen eliminates barries to communication true or false
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
Which action is good business etiquette? a. switching your cell phone off before you enter a meeting b. keeping your cell phone on low volume before you enter a meeting c. setting a pleasant ring tone on your cell phone before you enter a meeting d. setting a standard ringtone on your cell phone before you enter a meeting
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
question
Computers and Technology, 23.06.2019 07:50
Apython programming question: assume s is a string of lower case characters. write a program that prints the number of times the string 'bob' occurs in s. for example, if s = 'azcbobobegghakl', then your program should print number of times bob occurs is: 2
Answers: 3
You know the right answer?
In this exercise, you will write a class that models a band booster and use your class to update sal...
Questions
question
Mathematics, 12.03.2020 02:42
question
Mathematics, 12.03.2020 02:42
question
Mathematics, 12.03.2020 02:42
question
English, 12.03.2020 02:42
Questions on the website: 13722363