Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please post the code that is executed and the output! It will help me understand the process better. In this exercise, you will write a

please post the code that is executed and the output! It will help me understand the process better.
image text in transcribed
image text in transcribed
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 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 boxes Sold 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 boxes Sold AtoString 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 Enter the number of boxes sold by Joe this week: 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, For each member, after reading in the weekly sales, invoke the updatesalen 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) Here is a sample input/output Band Sales Program Enter the name of the first booster: Billy Enter the name of the second booster: Sally Enter the number of boxes sold by Billy week 1:12 Enter the number of boxes sold by Sally week 1:25 Enter the number of boxes sold by Billy week 2: 10 Enter the number of boxes sold by Sally week 2 15 Sales Totals Billy: 22 boxes Sally: 40 boxes

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

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions

Question

What were the issues and solutions proposed by each team?

Answered: 1 week ago

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago

Question

5. What information would the team members need?

Answered: 1 week ago