696 Chapter 10 Inheritance array that has the highest numeric score. The getLowe
ID: 663665 • Letter: 6
Question
696 Chapter 10 Inheritance array that has the highest numeric score. The getLowest method should return a reference to the element of the grades array that has the lowest numeric score. Demonstrate the new methods in a complete program. 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 Custoner, which extends the Person class. The Custoner class should have a field for a customer number and a boolean field indicating whether the cus- tomer wishes to be on a mailing list. Write one or more constructors and the appropriate mutator and accessor methods for the class's fields. Demonstrate an object of the Customer class in a simple program. 8. PreferredCustoner Class A retail store has a preferred customer plan where customers can earn discounts on all their purchases. The amount of a customer's discount is determined by the amount of the cus- tomer's cumulative purchases in the store as follows: . When a preferred customer spends $500, he or she gets a 5 percent discount on all . When a preferred customer spends $1,000, he or she gets a 6 percent discount on all . When a preferred customer spends $1,500, he or she gets a 7 percent discount on all . When a preferred customer spends $2,000 or more, he or she gets a 10 percent dis- future purchases. future purchases. future purchases. count on all future purchases. Design a class named PreferredCustoner, which extends the Custoner class you created in Programming Challenge 7. The PreterredCustoner class should have fields for the amount of the customers purchases and the customer's discount level. Write one or more construc- tors and the appropriate mutator and accessor methods for the class's fields. Demonstrate the class in a simple program. 9. BankAccount and SavingsAccount Classes Design an abstract class named BankAccount to hold the following data for a bank account: ance . Number of deposits this month .Number of withdrawals .Annual interest rate Monthly service charges The class should have the following methods The constructor should accept arguments for the balance and annual interest rate. Constructor:Explanation / Answer
class Person
{
public Person(String name, String address, int phone)
}
public String getName() {
return name;
}
public String getaddress() {
return address;
}
public int getphone() {
return phone;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.