First Problem Create an abstract class named “Customer”. Add 2 private fields to the class, “name” and “id”. Add a constructor that takes 2 arguments, “aName” and “aId”. Add the following abstract method “public abstract double discount();”

Its all 1 project.

First Problem Create an abstract class named “Customer”. Add 2 private fields to the class, “name” and “id”. Add a constructor that takes 2 arguments, “aName” and “aId”. Add the following abstract method “public abstract double discount();”

Second Problem Create a Child class of Customer named “OnlineCustomer”. Add a constructor that takes 2 arguments, name, id. Write the body of the inherited abstract discount method. Online customers get a 10% discount.

Third Problem. Create a JFrame class for your user interface named “CustomerJFrame”. Add a JLabel and JTextField for the Name. Add a JLabel and JTextField for the Id. Add a JLabel for the message output. Add a JButton for the Submit button. Add an ActionPerformed Listener for the submit button.

When the button is selected, create the OnlineCustomer object using the name and id from your JTextFields. Display the name, id and discount in the OnlineCustomer object in the message JLabel

Fourth Problem. Create a class named “CustomerApp” that has the main method. Create an object of your CustomerJFrame class.


Do you want a similar Paper? Click Here To Get It From Our Writing Experts At A Reasonable Price.

Leave a Reply

Your email address will not be published. Required fields are marked *