Computers and Technology
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).

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, icantspeakengles
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
image
Computers and Technology, 22.06.2019 17:30, glocurlsprinces
Rachel completed typing an official document with a word processing program. she wants to make sure that her document has no typographical errors. she also wants all headings to have the same font. which features in a word processing program should she use? rachel should use the feature in a word processing program to find typographical errors. she should apply to have uniform headings.
Answers: 1
image
Computers and Technology, 23.06.2019 05:30, savyblue1724707
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, kreshnikolloma
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
Do you know the correct answer?
In this exercise, you will write a class that models a band booster and use your class to update sal...

Questions in other subjects:

Konu
Spanish, 02.09.2019 10:30
Konu
Mathematics, 02.09.2019 10:30