Note:
Please find the below BandBooster and BandBoosterDriver classes. Also find the sample output.
Please revert back in case of any concerns.
Program:
BandBooster Class
public class BandBooster {
private String name;
private int boxesSold;
public BandBooster(String name) {
this.name = name;
this.boxesSold = 0;
}
public String getName() {
return name;
}
public void updateSales(int boxes) {
this.boxesSold = this.boxesSold + boxes;
}
@Override
public String toString() {
return name + ": " + boxesSold + " boxes";
}
}
BandBoosterDriver Class
import java.util.Scanner;
public class BandBoosterDriver {
public static void main(String[] args) {
Scanner userInput = new Scanner(System.in);
System.out.print("Enter the name of the band booster: ");
String boosterName1 = userInput.nextLine();
BandBooster booster1 = new BandBooster(boosterName1);
System.out.print("Enter the number of boxes sold by
"+booster1.getName()+" this week: ");
int boxesCount1 = userInput.nextInt();
userInput.nextLine();
booster1.updateSales(boxesCount1);
System.out.print("\nEnter the name of the band booster: ");
String boosterName2 = userInput.nextLine();
BandBooster booster2 = new BandBooster(boosterName2);
System.out.print("Enter the number of boxes sold by
"+booster2.getName()+" this week: ");
int boxesCount2 = userInput.nextInt();
userInput.nextLine();
booster2.updateSales(boxesCount2);
System.out.println("\nSales Information:");
System.out.println(booster1);
System.out.println(booster2);
userInput.close();
}
}
Output:
Enter the name of the band booster: Joe
Enter the number of boxes sold by Joe this week: 16
Enter the name of the band booster: Jim
Enter the number of boxes sold by Jim this week: 18
Sales Information:
Joe: 16 boxes
Jim: 18 boxes

Our teacher wants us to use a class and a driver class for this problem. Band...
Deliverable
A zipped NetBeans project with 2 classes
app
ZipCode
Address
Classes
Suggestion:
Use Netbeans to copy your last lab (Lab 03) to a new
project called Lab04.
Close Lab03.
Work on the new Lab04 project then.
The Address Class
Attributes
int number
String name
String type
ZipCode zip
String state
Constructors
one constructor with no input parameters
since it doesn't receive any input values, you need to use the
default values below:
number - 0
name - "N/A"
type...
In C++, Step 1: Implement the Student Class and write a simple main() driver program to instantiate several objects of this class, populate each object, and display the information for each object. The defintion of the student class should be written in an individual header (i.e. student.h) file and the implementation of the methods of the student class should be written in a corresponding source (i.e. student.cpp) file. Student class - The name of the class should be Student. -...
Java: Create a class called Vehicle with the following features: a. It has three private data members (instance variables): one is the manufacturer’s name (String manufacturer), the second is the number of cylinders in the engine (int cylinder), and the third is the owner (Person owner). The class Person is described above. b. It has three constructors, a no-argument constructor, a constructor with three parameters, and a copy constructor. The no-argument constructor will set the manufacturer to “None”, cylinder to...
Make a LandTract class with the following fields: LandTract is a rectangle. * length - an int containing the tract's length * width - an int containing the tract's width The class should have a constructor with two arguments length and width and assign these to the class variables. Now define a Copy Constructor: The constructor that you will write will be a copy constructor that uses the parameter LandTract object to make a duplicate LandTract object, by copying the...
JAVA /** * This class stores information about an instructor. */ public class Instructor { private String lastName, // Last name firstName, // First name officeNumber; // Office number /** * This constructor accepts arguments for the * last name, first name, and office number. */ public Instructor(String lname, String fname, String office) { lastName = lname; firstName = fname; officeNumber = office; } /** * The set method sets each field. */ public void set(String lname, String fname, String...
QUESTION 5 (15 Marks) Inheritance and Polymorphism Design a Ship class that has the following members: • A private String data field named name for the name of the ship. • A private String data field named yearBuilt for the year that the ship was built. • A constructor that creates a ship with the specified name and the specified year that the ship was built. • Appropriate getter and setter methods. A toString method that overrides the toString method...
Here is a sample run of the tester program: Make sure your program follows the Java Coding Guidelines. Consider the following class: /** * A store superclass with a Name and Sales Tax Rate */ public class Store { public final double SALES_TAX_RATE = 0.06; private String name; /** * Constructor to create a new store * @param newName */ public Store(String newName) { name = newName; } ...
Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super class. The class includes four private String instance variables: first name, last name, social security number, and state. Write a constructor and get methods for each instance variable. Also, add a toString method to print the details of the person. After that create a class Teacher which extends the class, Person. Add a private instance variable to store number of courses. Write a constructor...
using CSCI300 java Given the following UML Class Diagram Club_Card # card_num : String # name : String # age: int # year: int + Club_Card (all parameters) + Setters & Getters + toString() : String + equals(x: Object): boolean [10 pts] Define the class Club_Card, which contains: 1. All arguments constructor which accepts all required arguments from the main and instantiate a Club_Card object. 2. Set & get method for each data attribute. 3. A toString() method which returns...
This is for Java Programming Please use comments Customer and Employee data (15 pts) Problem Description: Write a program that uses inheritance features of object-oriented programming, including method overriding and polymorphism. Console Welcome to the Person Tester application Create customer or employee? (c/e): c Enter first name: Frank Enter last name: Jones Enter email address: frank44@ hot mail. com Customer number: M10293 You entered: Name: Frank Jones Email: frank44@hot mail . com Customer number: M10293 Continue? (y/n): y Create customer...