Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS170 Java Lab # 1 Ch. 8 Objects and Classes Activities: MusicBandSupporter Class In this Lab, you will () write a class that models a

image text in transcribed
CS170 Java Lab # 1 Ch. 8 Objects and Classes Activities: MusicBandSupporter Class In this Lab, you will () write a class that models a MusicBan dsupporter and, secondly, 2) use your class to update sales of music band bonbon boxes sold for a fundraising campaign. . Draw the UML class diagram for your design (relating the 2 classes below) Il. Write a class named MusicBandsupporter: 1. Write the code for a MusicBandSupporer class (use this name for both the class name and the java program file name; do Assume a MusicBandSupporter object is described by two PRIVATE instance data fields (note NOT use another name) the fields should be private): name (a String data type) of the supporter and numofBoxessold( represents the number of boxes, which the music band supporter has sold in the fundraising process). The class should have the following methods: an int data type that a. A constructor that has one parameter-a String containing the name of the music band supporter. The constructor should also set numofBoxessold to 0. A method ge b. t Name that returns the name of the band supporter (it has no parameters). void method updateSales that takes a single integer parameter representing the number of additional boxes of bonbons sold. The method should add this number to the numofBoxessold A tostring method that returms a String containing the name of the band supporter and the number of his/her boxe of bonbons sold in a format similar to the following: c. d. Jane: 20 boxes of bonbons sold. Ill. Test your class as follows

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions