[solved]-Create New Project Exercise Add New Class Called Retailltem Paste Code Retailltem Class Ho Q39055501

Create a new project for this exercise. Add a new class called Retailltem (paste the code for Retailltem class from Homework 6). You can import the class from Homework6 also, as an alternative. Add two more classes Customer and CustItemTest. In Customer class, add following fields (variables): int id, String firstName, String lastName and String email. Add corresponding set and get methods. Add a constructor to set values for all fields. Add a toString method, like this. public String toString() { return “ID:” + getld() + ” Name:” + getFirstName()+””+getLastName(); In CustitemTest class, create objects of the two classes like this: public class CustItemTest { public static void main(String[] args) { Customer aCustomer = new Customer(100, “John”, “Doe”,”jdoe@email.com”); RetailItem[] items = new RetailItem[5]; items[@] = new RetailItem(“Item 1”, 10, 10.95); items[1] = new RetailItem(“Item 2”, 15, 9.95); items [2] = new RetailItem(“Item 3”, 5, 14.95); items [3] = new RetailItem(“Item 4”, 9, 19.95); items [4] = new RetailItem(“Item 5”, 7, 2.95); //print all items for(int i ;icitems.length; i++) System.out.println(items[i]); //print customer info System.out.println(aCustomer); We were unable to transcribe this imageShow transcribed image text Create a new project for this exercise. Add a new class called Retailltem (paste the code for Retailltem class from Homework 6). You can import the class from Homework6 also, as an alternative. Add two more classes Customer and CustItemTest. In Customer class, add following fields (variables): int id, String firstName, String lastName and String email. Add corresponding set and get methods. Add a constructor to set values for all fields. Add a toString method, like this. public String toString() { return “ID:” + getld() + ” Name:” + getFirstName()+””+getLastName(); In CustitemTest class, create objects of the two classes like this: public class CustItemTest { public static void main(String[] args) { Customer aCustomer = new Customer(100, “John”, “Doe”,”jdoe@email.com”); RetailItem[] items = new RetailItem[5]; items[@] = new RetailItem(“Item 1”, 10, 10.95); items[1] = new RetailItem(“Item 2”, 15, 9.95); items [2] = new RetailItem(“Item 3”, 5, 14.95); items [3] = new RetailItem(“Item 4”, 9, 19.95); items [4] = new RetailItem(“Item 5”, 7, 2.95); //print all items for(int i ;icitems.length; i++) System.out.println(items[i]); //print customer info System.out.println(aCustomer);
Expert Answer
Answer to Create a new project for this exercise. Add a new class called Retailltem (paste the code for Retailltem class from Home… . . .
OR

