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 10:30
This first part of the film shows the early history of motion pictures. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theatre productions? explain. in the scene where don is going to the party (starting at time code 14: 51), we see a street scene as he first rides with cosmo and then with kathy. what aspects did the filmmaker include to make the scene look and feel like don, cosmo, and kathy are riding in a car on a street? think about elements such as scenery, sound, props, lighting, and so on. a "talkie" picture is shown starting around time code 21: 15. how does the audience in the film react to the "talkie"? what influence do audiences have on film and theatre performances? how do film and theatre actors influence audiences? in the musical scene with cosmo (starting at time code 27: 00), how does the actor use props? what is the result? do you think the use of props effectively fulfilled the artistic vision for this musical number? why or why not?
Answers: 1
question
Computers and Technology, 22.06.2019 16:30
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Choose the answers that best complete each sentence. on average,are more expensive than other kinds of postsecondary schools. the cost of room and board includes. to save money, some students attend auniversity in their home state.
Answers: 2
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, 16.04.2020 00:56
question
Mathematics, 16.04.2020 00:56
question
Mathematics, 16.04.2020 00:56
question
Mathematics, 16.04.2020 00:57
Questions on the website: 13722360