Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Hello i am getting a few errors in my code: Customer.java package Cust; /* * To change this license header, choose License Headers in

JAVA

Hello i am getting a few errors in my code:

Customer.java

package Cust;

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */

/** * * @author MrMarkycoolsuper */ import java.util.ArrayList; public class Customer {

/** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here } private String CustID; private String CustName; private String CustEmail; private boolean isPreferred; public Customer(){} public Customer(String id, String n, String e, boolean p){ CustID = id; CustName = n; CustEmail = e; isPreferred = p; }

/** * @return the CustID */ public String getCustID() { return CustID; }

/** * @param CustID the CustID to set */ public void setCustID(String CustID) { this.CustID = CustID; }

/** * @return the CustName */ public String getCustName() { return CustName; }

/** * @param CustName the CustName to set */ public void setCustName(String CustName) { this.CustName = CustName; }

/** * @return the CustEmail */ public String getCustEmail() { return CustEmail; }

/** * @param CustEmail the CustEmail to set */ public void setCustEmail(String CustEmail) { this.CustEmail = CustEmail; }

/** * @return the isPreferred */ public boolean isIsPreferred() { return isPreferred; }

/** * @param isPreferred the isPreferred to set */ public void setIsPreferred(boolean isPreferred) { this.isPreferred = isPreferred; } ArrayListallCustomers=new ArrayList<>();

allCustomers.add(new Customer("1234","Dawn Patitucci","patitucci@morainevally.edu",false)); allCustomers.add(new Customer("5678","Fred Flintstone","flintstone@gma.com",false)); allCustomers.add(new Customer("9012","Hello Kitty","hello_ketty@gma.com",false)); allCustomers.add(new PreferredCustomer("3456","Marcia Drady","marcia_Drady@gma.com",true,25,1000)); allCustomers.add(new PreferredCustomer("7890","Abraham Lincon","pres_lincon@gm.com",true,50,2000)); System.out.println("ID\tCUSTOMER NAME\t\t EMAIL ADDRESS\t\t\t PREFERRED?"); System.out.println("------------------------------------------------------------------------------"); for (Customer allCustomer : allCustomers) { System.out.println(allCustomer); } } @Override public String toString() { String pre; if(isPreferred) pre="Yes"; else pre="No"; return String.format("%1$-8s", CustID)+ String.format("%1$-25s", CustName)+ String.format("%1$-35s", CustEmail)+ String.format("%1$-10s", pre); } }

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package Cust;

/**

*

* @author MrMarkycoolsuper

*/

public class PreferredCustomer extends Customer {

private double discount;

private int points;

public PreferredCustomer(){}

public PreferredCustomer (String id, String n, String e, boolean p,double discount,int points){

}

super(id,n,e,p);

this.discount=getDiscount;

this.points=getPoints;

/**

* @return the discount

*/

public double getDiscount() {

return discount;

}

/**

* @param discount the discount to set

*/

public void setDiscount(double discount) {

this.discount = discount;

}

/**

* @return the points

*/

public int getPoints() {

return points;

}

/**

* @param points the points to set

*/

public void setPoints(int points) {

this.points = points;

}

@Override

public String toString()

{

return (super.toString()+" \tPREFERRED DISCOUNT RATE: " +this.discount+"%\t\tREWARD POINTS:"+this.points)

}

}

PreferredCustomer.java

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Cust;

/** * * @author MrMarkycoolsuper */ public class PreferredCustomer extends Customer { private double discount; private int points;

public PreferredCustomer(){}

public PreferredCustomer (String id, String n, String e, boolean p,double discount,int points){

} super(id,n,e,p); this.discount=getDiscount; this.points=getPoints;

/** * @return the discount */ public double getDiscount() { return discount; }

/** * @param discount the discount to set */ public void setDiscount(double discount) { this.discount = discount; }

/** * @return the points */ public int getPoints() { return points; }

/** * @param points the points to set */ public void setPoints(int points) { this.points = points; } @Override public String toString() { return (super.toString()+" \tPREFERRED DISCOUNT RATE: " +this.discount+"%\t\tREWARD POINTS:"+this.points) }

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

Question Can plan participants borrow from a VEBA?

Answered: 1 week ago