input code:

![public static void main(String[] args) { /*make object of CustomerPoints/ Customer Points cust=new Customer Points(Carl); /](http://img.homeworklib.com/questions/a08514e0-a874-11eb-8500-27e53ea18058.png?x-oss-process=image/resize,w_560)
output:

code:
public class CustomerPoints{
/*declare the variables*/
public String myName;
public int myPoints;
/*constructor*/
public CustomerPoints(String theName)
{
myName=theName;
myPoints=0;
}
/*return the myName*/
public String getName()
{
return myName;
}
/*return the myPoints*/
public int getPoints()
{
return myPoints;
}
/*make points to zero*/
public void clearPoints()
{
myPoints=0;
}
/*add points into current points*/
public void addPoints(int thePoints)
{
myPoints+=thePoints;
}
/*substract points from myPoints*/
public void reducePoints(int thePoints)
{
myPoints-=thePoints;
/*and if it is goes less than zero than set to 0*/
if(myPoints<0)
{
myPoints=0;
}
}
/*Override toString method*/
public String toString()
{
return myName+" "+myPoints;
}
public static void main(String[] args) {
/*make object of CustomerPoints*/
CustomerPoints cust=new CustomerPoints("Carl");
/*print */
System.out.println(cust);
/*add values*/
cust.addPoints(5);
cust.addPoints(12);
System.out.println(cust);
/*remove values*/
cust.reducePoints(2);
System.out.println(cust);
/*clear values*/
cust.clearPoints();
/*prin the output*/
System.out.println(cust);
}
}
blanks:

Classes A Customer Points class maintains information about a customer. This information is the customer name...
4. Command pattern //class Stock public class Stock { private String name; private double price; public Product(String name, double price) { this.name = name; this.price = price; } public void buy(int quantity){ System.out.println(“BOUGHT: “ + quantity + “x “ + this); } public void sell(int quantity){ System.out.println(“SOLD: “ + quantity + “x “ + this); } public String toString() { return “Product [name=” + name + “, price=” + price + “]”; } } a. Create two command classes that...
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...
Add additional information to the student class below such as name, address, major, and contact information along with all the getters and setters (methods) needed to access all data. Submit your code along with a sample run of your program. Comment all your code. Cite any sources of information you use. Write a note on the process of completing the assignment in a Microsoft Word document. // ShowStudent.java // client to test the Student class class ShowStudent { public static...
Add additional information to the student class below such as name, address, major, and contact information along with all the getters and setters (methods) needed to access all data. Submit your code along with a sample run of your program. Comment all your code. Cite any sources of information you use. Write a note on the process of completing the assignment in a Microsoft Word document. // ShowStudent.java // client to test the Student class class ShowStudent { public static...
Correct the mistakes public class customer { public static void main(String[] args) { D customer=new d(); d.employee(56,”ali”); d.department(7,8.6,9); } public void employee(String name, int age) { System.out.println("Your name is"+name); System.out.println(“Age is”+age); } public int department(double d, double t, int a) { System.out.println("I have java exam at 3:00"); Return(1.1); } } V. PROGRAMMING. Write a complete JAVA program to implement the following. 1. Create a class named Exponent. Its main() method accepts an integer value from a user at the keyboard,...
This is my playlist class: class Playlist{ private String name; private int numberOfRecordings = 0; private int durationInSeconds = 0; private int MAX_PLAYLIST_SIZE; Recording recordingslist[]; Playlist(){ name = "Unknown"; MAX_PLAYLIST_SIZE = 5; recordingslist = new Recording[MAX_PLAYLIST_SIZE]; durationInSeconds = 0; } Playlist(String name, int size){ this.name = name; this.MAX_PLAYLIST_SIZE = size; recordingslist = new Recording[MAX_PLAYLIST_SIZE]; ...
Use inheritance to create a new class AudioRecording based on Recording class that: it will retain all the members of the Recording class, it will have an additional field bitrate (non-integer numerical; it cannot be modified once set), its constructors (non-parametrized and parametrized) will set all the attributes / fields of this class (reuse code by utilizing superclass / parent class constructors): Non-parametrized constructor should set bitrate to zero, If arguments for the parametrized constructor are illegal or null, it...
In java 8. Modify the averageTopSpeed() method (in the class FormulaOne) using only lambdas and streams and print it to the terminal via the driver class: import java.util.*; public class Racer implements Comparable { private final String name; private final int year; private final int topSpeed; public Racer(String name, int year, int topSpeed){ this.name = name; this.year = year; this.topSpeed = topSpeed; } public String toString(){ return name + "-" + year + ", Top...
In this assignment, we will be making a program that reads in customers' information, and create a movie theatre seating with a number of rows and columns specified by a user. Then it will attempt to assign each customer to a seat in a movie theatre. 1. First, you need to add one additional constructor method into Customer.java file. Method Description of the Method public Customer (String customerInfo) Constructs a Customer object using the string containing customer's info. Use the...
How to create a constructor that uses parameters from different classes? I have to create a constructor for the PrefferedCustomer class that takes parameters(name, address,phone number, customer id, mailing list status, purchase amount) but these parameters are in superclasses Person and Customer. I have to create an object like the example below....... PreferredCustomer preferredcustomer1 = new PreferredCustomer("John Adams", "Los Angeles, CA", "3235331234", 933, true, 400); System.out.println(preferredcustomer1.toString() + "\n"); public class Person { private String name; private String address; private long...