thanks for the question, here are the complete code with output sample.
Comments given for all important line of code, let me know in case you need any help or have questions.
===========================================================================
public class Person {
private String name;
private String address;
private String telephone;
public Person() {
this.name = "";
this.address = "";
this.telephone = "";
}
public Person(String name, String address, String telephone) {
this.name = name;
this.address = address;
this.telephone = telephone;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
}
===========================================================================
public class Customer extends Person {
private int customerNumber;
private boolean inMailingList;
public Customer(int number) {
this.customerNumber = number;
this.inMailingList = true;
}
public Customer(int customerNumber, boolean inMailingList) {
this.customerNumber = customerNumber;
this.inMailingList = inMailingList;
}
public Customer(String name, String address, String telephone, int customerNumber, boolean inMailingList) {
super(name, address, telephone);
this.customerNumber = customerNumber;
this.inMailingList = inMailingList;
}
public int getCustomerNumber() {
return customerNumber;
}
public void setCustomerNumber(int customerNumber) {
this.customerNumber = customerNumber;
}
public boolean isInMailingList() {
return inMailingList;
}
public void setInMailingList(boolean inMailingList) {
this.inMailingList = inMailingList;
}
}
===========================================================================
public class PreferredCustomer extends Customer {
private double purchaseAmount;
private double discount;
public PreferredCustomer(int number) {
super(number);
purchaseAmount=0;
discount=getDiscount();
}
public PreferredCustomer(int customerNumber, boolean inMailingList) {
super(customerNumber, inMailingList);
purchaseAmount=0;
discount=getDiscount();
}
public PreferredCustomer(String name, String address, String telephone, int customerNumber, boolean inMailingList) {
super(name, address, telephone, customerNumber, inMailingList);
purchaseAmount=0;
discount=getDiscount();
}
public void setPurchaseAmount(double purchaseAmount) {
this.purchaseAmount = purchaseAmount;
discount=getDiscount();
}
// logic to determine the discount given to customer
private double getDiscount(){
if(purchaseAmount>=2000)return 10;
if(purchaseAmount>=1500)return 7;
if(purchaseAmount>=1000)return 6;
if(purchaseAmount>=500)return 5;
return 0;
}
// amount purchased by customer
public double getPurchaseAmount() {
return purchaseAmount;
}
// amount charged to customer after discount
public double getPayableAmount(){
return (100-getDiscount())*purchaseAmount/100.0;
}
// discounted amount
public double getTotalDiscount(){
return (getDiscount())*purchaseAmount/100.0;
}
// prints the receipt of the customer
public void printBill(){
System.out.println("Name : "+getName());
System.out.println("Address : "+getAddress());
System.out.println("Telephone : "+getTelephone());
System.out.println("Total Purchase Amount $"+getPurchaseAmount());
System.out.println("Discount (%)Availed : "+getDiscount()+"%");
System.out.println("Total Discount : $"+getTotalDiscount());
System.out.println("Total Amount Payable: $"+getPayableAmount());
}
}
===========================================================================
public class PreferredCustomer extends Customer {
private double purchaseAmount;
private double discount;
public PreferredCustomer(int number) {
super(number);
purchaseAmount=0;
discount=getDiscount();
}
public PreferredCustomer(int customerNumber, boolean inMailingList) {
super(customerNumber, inMailingList);
purchaseAmount=0;
discount=getDiscount();
}
public PreferredCustomer(String name, String address, String telephone, int customerNumber, boolean inMailingList) {
super(name, address, telephone, customerNumber, inMailingList);
purchaseAmount=0;
discount=getDiscount();
}
public void setPurchaseAmount(double purchaseAmount) {
this.purchaseAmount = purchaseAmount;
discount=getDiscount();
}
// logic to determine the discount given to customer
private double getDiscount(){
if(purchaseAmount>=2000)return 10;
if(purchaseAmount>=1500)return 7;
if(purchaseAmount>=1000)return 6;
if(purchaseAmount>=500)return 5;
return 0;
}
// amount purchased by customer
public double getPurchaseAmount() {
return purchaseAmount;
}
// amount charged to customer after discount
public double getPayableAmount(){
return (100-getDiscount())*purchaseAmount/100.0;
}
// discounted amount
public double getTotalDiscount(){
return (getDiscount())*purchaseAmount/100.0;
}
// prints the receipt of the customer
public void printBill(){
System.out.println("Name : "+getName());
System.out.println("Address : "+getAddress());
System.out.println("Telephone : "+getTelephone());
System.out.println("Total Purchase Amount $"+getPurchaseAmount());
System.out.println("Discount (%)Availed : "+getDiscount()+"%");
System.out.println("Total Discount : $"+getTotalDiscount());
System.out.println("Total Amount Payable: $"+getPayableAmount());
}
}
===========================================================================

thanks a lot !
Assignment 6 Due: Apr 12, 2019 at 11:59 PM A6 OOP 3 "PreferredCustomer Class" (need to...
this is java m. please use netbeans if you can.
7. Person and Customer Classes Design a class named Person with fields for holding a person's name, address, and telephone number. Write one or more constructors and the appropriate mutator and accessor methods for the class's fields. Next, design a class named Customer, which extends the Person class. The Customer class should have a field for a customer number and a boolean field indicating whether the cus- tomer wishes to...
This must be written in C# with overloaded constructors and member initialization list 4. Person and Customer Classes Design a class named Person with properties for holding a person's name, address, and telephone number. Next, design a class named Customer, which is derived from the Person class. The Customer class should have a property for a customer number and a Boolean property indicating whether the customer wishes to be on a mailing list. Demonstrate an object of the Customer class...
Please use Java Question 3: Person and Customer classes: Design a class named Person with properties for holding a person's name, address, and telephone number. Next, design a class named Customer, which is derived from the Person class. The Customer class should have a property for a customer number and a Boolean property indicating whether wishes to be on a mailing list. Demonstrate an object of customer class in a simple GUI application. Write the code include appropriate input validation,...
Design a class named Person with fields for holding a person's name, address, and telephone number (all as Strings). Write a constructor that initializes all of these values, and mutator and accessor methods for every field. Next, design a class named Customer, which inherits from the Person class. The Customer class should have a String field for the customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write a constructor that initializes...
Using JAVA* Design a class named Person with fields for holding a person’s name, address, and telephone number. Write one or more constructors and the appropriate mutator and accessor methods for the class’s fields. Next, design a class named Customer, which extends the Person class. The Customer class should have a field for a customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write one or more constructors and the appropriate mutator...
This is a C++ program Instructions Design a class named PersonData with the following member variables declared as strings: lastName firstName address city state zip phone Create 3 constructors; a default constructor, a constructor that accepts the first and last name member variables, and a constructor that accepts all member variables. Write the appropriate accessor/getter and mutator/setter functions for these member variables. Create a method within this class called getFullName() that returns the person's first and last names as a...
Programming Assignment 6: Object Oriented Programming Due date: Check Syllabus and Canvas Objectives: After successfully completing this assignment, students will practice Object Oriented design and programming by creating a Java program that will implement Object Oriented basic concepts. RetailItem Class: Part 1: Write a class named RetailItem that holds data about an item in a retail store. The class should have the following fields: • description. The description field references a String object that holds a brief description of the...
And there was a buy-sell arrangement which laid out the
conditions under which either shareholder could buy out the other.
Paul knew that this offer would strengthen his financial
picture…but did he really want a partner?It was going to be a long
night.
read the case study above and answer this question
what would you do if you were Paul with regards to financing,
and why?
ntroductloh Paul McTaggart sat at his desk. Behind him, the computer screen flickered with...