The Customer class is an abstract superclass and it holds features that are common to all of
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Customer -firstName: String -lastName: String -custID: String Customer( firstName: String, lastName: String, custID: String): +getFirstName(): String +getLastName (): String +getCustID(): String +setFirstName(name: String): void +setLastName(name: String): void +setCustID(custID: String): void +getCustomerDetails(): String +getIncentives(): String BusinessCustomer -companyName: String -discountRate: double -totalPurchases: double Business Customer( firstName: String, lastName,: String, custID: String, companyName: String, discountRate: double, totalPurchases: double) +getDiscountRate(): double +setDiscountRate(discountRate: double): void +getTotalPurchases(): double +setTotalPurchases(purchases: double): void +getCompanyName(): String +setCompanyName(name: String): void +getCustomerDetails(): String +getIncentives(): String RetailCustomer -totalPurchases:double RetailCustomer( firstName: String, lastName: String, custID: String, totalPurchases: double) +getTotalPurchases(): double +setTotalPurchases(purchases: double): void +determine IncentiveRate(): double +getCustomerDetails(): String +getIncentives(): String The Customer class is an abstract superclass and it holds features that are common to all of its subclasses. All customers have a first and last name and a customerID. Note that there is a 3-arg constructor. Each of the private variables has a corresponding getter and setter method. There is also a method called getCustomer Details, which will return a string that lists the CustomerID, first name and last name of a customer. It does this by making calls to each of the getter methods and concatenating the String values that are returned by each getter into one long String. The getIncentives() method is an abstract method which will be implemented by each sub class of Customer There are different types of incentives for each kind of customer, so we'll over-ride this method in each sub class. The BusinessCustomer class is a sub class of Customer and represents a customer who has a representative with a name as well as a company name. There is a discount rate applied to each business customer, depending on who they are. This discount rate applied when a new customer is created. It can be overwritten anytime, utilizing the setDiscountRate mutator method. It has a 6-arg constructor. It also has a getter method for the discount rate. Also it has setter and getter methods for company Name and totalPurchases. Over-ride the getCustomerDetails() for this class so that it will return all of the details of the super class method along with a concatenated string that states that "Business Customer: with the company name: company Name. The getIncentives() method implementation for this class will simply return a string indicating what discount or incentive the customer is entitled to. The RetailCustomer class is also a sub class of Customer and represents a customer who frequents this company regularly. They have a first name, last name, and customer id. They also have made total purchases over the year. This has a 4 arg constructor. The getCustomerDetails method will return all the details of the super class method along with the concatenated string that states: "Retail Customer:" The getIncentives method for this class will return a string indicating the total incentive the customer is entitled too. The determineIncentiveRate Method will determine the actual discount rate. If total purchases are greater than $1000.00, they will get 5%, greater than $5000.00, they will get 10%. Greater than 10000, they will get 15%. (continued on next page) Customer -firstName: String -lastName: String -custID: String Customer( firstName: String, lastName: String, custID: String): +getFirstName(): String +getLastName (): String +getCustID(): String +setFirstName(name: String): void +setLastName(name: String): void +setCustID(custID: String): void +getCustomerDetails(): String +getIncentives(): String BusinessCustomer -companyName: String -discountRate: double -totalPurchases: double Business Customer( firstName: String, lastName,: String, custID: String, companyName: String, discountRate: double, totalPurchases: double) +getDiscountRate(): double +setDiscountRate(discountRate: double): void +getTotalPurchases(): double +setTotalPurchases(purchases: double): void +getCompanyName(): String +setCompanyName(name: String): void +getCustomerDetails(): String +getIncentives(): String RetailCustomer -totalPurchases:double RetailCustomer( firstName: String, lastName: String, custID: String, totalPurchases: double) +getTotalPurchases(): double +setTotalPurchases(purchases: double): void +determine IncentiveRate(): double +getCustomerDetails(): String +getIncentives(): String The Customer class is an abstract superclass and it holds features that are common to all of its subclasses. All customers have a first and last name and a customerID. Note that there is a 3-arg constructor. Each of the private variables has a corresponding getter and setter method. There is also a method called getCustomer Details, which will return a string that lists the CustomerID, first name and last name of a customer. It does this by making calls to each of the getter methods and concatenating the String values that are returned by each getter into one long String. The getIncentives() method is an abstract method which will be implemented by each sub class of Customer There are different types of incentives for each kind of customer, so we'll over-ride this method in each sub class. The BusinessCustomer class is a sub class of Customer and represents a customer who has a representative with a name as well as a company name. There is a discount rate applied to each business customer, depending on who they are. This discount rate applied when a new customer is created. It can be overwritten anytime, utilizing the setDiscountRate mutator method. It has a 6-arg constructor. It also has a getter method for the discount rate. Also it has setter and getter methods for company Name and totalPurchases. Over-ride the getCustomerDetails() for this class so that it will return all of the details of the super class method along with a concatenated string that states that "Business Customer: with the company name: company Name. The getIncentives() method implementation for this class will simply return a string indicating what discount or incentive the customer is entitled to. The RetailCustomer class is also a sub class of Customer and represents a customer who frequents this company regularly. They have a first name, last name, and customer id. They also have made total purchases over the year. This has a 4 arg constructor. The getCustomerDetails method will return all the details of the super class method along with the concatenated string that states: "Retail Customer:" The getIncentives method for this class will return a string indicating the total incentive the customer is entitled too. The determineIncentiveRate Method will determine the actual discount rate. If total purchases are greater than $1000.00, they will get 5%, greater than $5000.00, they will get 10%. Greater than 10000, they will get 15%. (continued on next page)
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class TestCustomer public static void mainString args Create an array of type Customer named customerArray and size it t... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
2. (a)Determine if each of the following pin-jointed frameworks is statically determinate, redundant or a mechanism (unstable). If they do not comply with the configuration for statically determine...
-
Business Process, Inc. (BPI), a consulting company offering business process reengineering and application system development expertise, wants to develop a prototype of a simple University...
-
The CPA rm of which you are a manager has placed you incharge of the audit of the Thornburg School District. The district receives substantial nancial support from the State Education Agency. The...
-
In Problems 1158, perform the indicated operation, and write each expression in the standard form a + bi. i 7 (1 + i 2 )
-
You have the following information for Gas Saver Plus. Gas Saver Plus uses the periodic method of accounting for its inventory transactions. March 1 Beginning inventory 1,500 litres at a cost of 40...
-
You travel to an alternate universe where the atomic orbitals are different from those on earth, but all other aspects of the atoms are the same. In this universe, you find that the first (lowest...
-
You and Maria each own identical spaceships. As you fly past Maria, you measure her ship to be \(90 \mathrm{~m}\) long and your own ship to be \(100 \mathrm{~m}\) long. a. How long does Maria measure...
-
The overhead costs that Lucca Industries, Inc., used to compute its overhead rate for the past year are as follows: Indirect materials and supplies ........ $ 79,200 Repairs and maintenance...
-
A conservative investor has a well-diversified portfolio but is still concerned about two things. First, he is concerned about the downside risk and secondly, he is concerned whether he is earning a...
-
IBS is a global provider of point-of-sale systems and related services that enable businesses to accept electronic payments. As a new hire in the companys international headquarters accounting...
-
4. A circular room has a diameter of 12 m and a side-wall height of 10 m. The ceiling is a diffuse transmitter (transmittance equal to 0.3), which allows daylight goes into the space. a) Daylight...
-
a . The initial speed of a body is 3 . 7 8 m / s . What is its speed after 1 . 9 s if it accelerates uniformly at 4 . 1 2 m / s ^ 2 ? Answer in units of m / s . b . What is its speed after 1 . 9 s if...
-
Can you explain what management earnings guidance walkdown is? Why do managers choose to conduct the walkdown? Further, why do they often manage to walkdown analysts' forecasts?
-
A window pane made of a glass of refractive index 1 . 5 5 is covered with on one side only with a transparent film of refractive index of 1 . 4 0 . Calculate the critical angle of the film glass...
-
A mercury in glass thermometer has a 1 0 . 8 mm column at the ice point of water and 1 4 . 9 mm at the steam point. It is immersed in a bath of hot oil and a column height of 1 6 . 6 mm is measured....
-
Carbon dioxide is at a gauge pressure of 1 bar ( g ) and a temperature of 2 0 0 o C degrees. Determine how big the kinematic viscosity will be ?
-
Scheduling deals with which three conflicting objectives? A. High efficiency, high profits, and short lead-time B. High profits, low inventories, and good customer service C. Low inventories, high...
-
Interview managers at three companies in your area about their use of ERP. How have their experiences been similar? What accounts for the similarities and differences?
-
How do you specify the active database in SQL Server 2014?
-
What is the purpose of this book?
-
Describe four uses of a primary key.
-
Novo Nordisk is a Denmark-based biopharmaceutical company with a focus on diabetes drugs. The company provides detailed disclosure of revenue along geographic, business segment, and product lines....
-
Use the data in Example 1 on Novo Nordisk to answer the following questions: i. Xiaoping Wu is an equity analyst covering European pharmaceutical companies for his clients in China. Wu projects that...
-
Walgreens and Rite Aid are two of the largest retail drugstore chains in the United States. For both companies, around two-thirds of their sales are from prescription pharmaceuticals, with the...
Study smarter with the SolutionInn App