PreferredCustomer.java - The PreferredCustomer class stores...

This preview shows page 1 - 2 out of 2 pages.

/** The PreferredCustomer class stores data about a person who is a customer that can earn discounts for the Person and Customer Classes programming challenge. */ //STEP 1: Make Preferred Customer inherit from Customer: public class PreferredCustomer extends Customer { private double purchases; // Amount of purchases private double discountLevel; // Discount level /** The no-arg constructor initializes the object with empty strings for name, address, phone, and customerNumber. The mailingList field is set to false. The purchases and discountLevel fields are set to 0.0. */ public PreferredCustomer() { super(); purchases = 0.0; discountLevel = 0.0; } //STEP 2: Create this constructor: /** This constructor initializes the object with a name, address, a phone number, a customer number, mailing list status, and amount of purchases @param n The name. @param a The address. @param p The phone number. @param c The customer number. @param m Mailing list status (true = yes, false = no). @param pur Amount of purchases.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture