Question: Modify the coding below to fulfill the managers request. You are working for an online retail store that sells clothing. Your manager has asked you
Modify the coding below to fulfill the managers request.
You are working for an online retail store that sells clothing. Your manager has asked you to modify the Customer class so that it assigns a new unique customer ID number when a customer object is created. The current implementation constructs a new Customer object using the ID number supplied as a parameter.
/** A class representing a Customer */ public class Customer { // instance variables private int idNumber; // customer ID number private String name; // customer name private ShoppingCart items; // customers shopping cart of // to-be-purchased items private Address mailingAddress; // customers mailing address /** Construct a new customer object with idNumber, name, and * mailing address */ public Customer(int idNumber, String name, Address mailingAddress) { this.idNumber = idNumber; nextIDNumber; nextIDNumber++; // added this.name = name; this.mailingAddress = mailingAddress; this.items = new ShoppingCart(); } // other methods omitted to save space }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
