How to fix this code and get out put? Create a Customer class that encapsulates the concept
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a Customer class that encapsulates the concept of a customer, assuming that a customer has the following attributes: a name and a credit score. Include a constructor and setter/getter methods for name and credit score. Create a Customer Creator class to test all the methods in your class. Customer Class • Include a name and creditScore class fields (instance variables). Initialize the name variable to null and the credit score variable to 300. (2 points) • Include a constructor to set the name and creditScore of the customer when the object is created. The constructor should take in two parameters and should call setter methods for name and creditScore. (2 points) • Create a setName method that sets the value of the customer's name. (1 point) • Create a getName method that returns the name of the customer. (1 point) • Create a setCreditScore method. (1 point) • Add validation to the setCreditScore method. Credit score must be at least 300, otherwise it should be set to 300. (2 points) • Create a getCreditScore method that returns the credit score of the customer. (1 point) • Create a getCreditRating method that returns the rating of the credit score this will be based on the credit score field. (5 points) • Bad (Score 200-629) . Fair (Score 630-689) . Good (Score 690-719) • Excellent (Score 720-850) Customer Creator Class • Create a customer object including a name and a credit score. (2 points) . Call the getName, getCreditScore, and getCreditRating for this student and print the results. (3 points) Create a Customer class that encapsulates the concept of a customer, assuming that a customer has the following attributes: a name and a credit score. Include a constructor and setter/getter methods for name and credit score. Create a Customer Creator class to test all the methods in your class. Customer Class • Include a name and creditScore class fields (instance variables). Initialize the name variable to null and the credit score variable to 300. (2 points) • Include a constructor to set the name and creditScore of the customer when the object is created. The constructor should take in two parameters and should call setter methods for name and creditScore. (2 points) • Create a setName method that sets the value of the customer's name. (1 point) • Create a getName method that returns the name of the customer. (1 point) • Create a setCreditScore method. (1 point) • Add validation to the setCreditScore method. Credit score must be at least 300, otherwise it should be set to 300. (2 points) • Create a getCreditScore method that returns the credit score of the customer. (1 point) • Create a getCreditRating method that returns the rating of the credit score this will be based on the credit score field. (5 points) • Bad (Score 200-629) . Fair (Score 630-689) . Good (Score 690-719) • Excellent (Score 720-850) Customer Creator Class • Create a customer object including a name and a credit score. (2 points) . Call the getName, getCreditScore, and getCreditRating for this student and print the results. (3 points)
Expert Answer:
Answer rating: 100% (QA)
class Customer private String name private int creditScore Con... View the full answer
Related Book For
Modern Systems Analysis And Design
ISBN: 9780134204925
8th Edition
Authors: Joseph Valacich, Joey George
Posted Date:
Students also viewed these programming questions
-
Student Bank is an online bank focused on students. In 2022, Student Bank had $100 million in loans it retained and $50 million in pass-through loans. It earned 19% interest and 3% origination fee on...
-
I have an assignment which is called SEC 10-K Company Report where, I choose lululemon athletica inc. for my SEC 10-K company. I will send you the link of lululemon athletica inc. SEC 10-K company...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Comparative figures from the statement of profit or loss of Misty Ltd are shown below: 2017 2016 Revenue (all sales) Cost of sales $450 000 292 300 $390 000 287 000 Gross profit Expenses (including...
-
A mass-loaded piston/cylinder containing air is at 45 lbf/in 2, 60 F with a volume of 9 ft3, while at the stops V 36 ft3. An air line, 75 lbf/in 2, 1100 R, is connected by a valve....
-
A rock falling off the edge of a tall cliff falls 16t^(2) feet in the first t seconds. Evaluate 16t^(2) for t=9 to find the distance the rock would fall in the first 9 seconds.
-
Visit the website www.nielsen.com and choose one of the reports published. Write a brief analysis of the findings and solutions presented by the report.
-
In a pure exchange economy with two goods, G and H, the two traders have Cobb-Douglas utility functions. Suppose that Tony's utility function is Ut = GtHt and Margaret's utility function is Um =...
-
An asset manager enters into a one-year equity swap in which he will receive the return on the Nasdaq 100 Index in return for paying a floating interest rate. The swap calls for quarterly payments....
-
For the simple pendulum shown in Figure CP2.7, the nonlinear equation of motion is given by where L = 0.5 m, m = 1 kg, and g = 9.8 m/s2. When the nonlinear equation is linearized about the...
-
Write a query to display the name and transaction id of the employees whose transaction amount was greater than 100000 Task 2 Write a query to display all the customer names with their saving...
-
What is a composite income tax return?
-
According to the pure expectations theory, what would happen if long-term rates were not an average of expected short-term rates?
-
Explain why this statement is true: A dollar in hand today is worth more than a dollar to be received next year.
-
Define each of the following terms: a. Spot markets; futures markets b. Money markets; capital markets c. Primary markets; secondary markets d. Private markets; public markets e. Derivatives f....
-
Can investors be confident that if the financial statements of different companies are accurate and are prepared in accordance with GAAP, the data reported by one company will be comparable to the...
-
Straitway Company encourages its managers to behave ethically,reasoning that the employees will take their cues from management.One of the most important ways to create and maintain an...
-
Using Apple, demonstrate how the differentiation strategy can be well implemented.
-
Explain Lucass model of implementation success.
-
What measures do many development groups use to assess a systems usability?
-
You read in this chapter about the advantages of client/server architectures. What operational and management problems can be created by client/server architectures? Considering both the advantages...
-
Understanding the Feds actions that are needed to stabilize the interest rate The diagram below shows three different money demand curves and a target interest rate i*. Fill in the table below using...
-
This section looks at US recessions over the past 60 years. To work out this problem, first obtain quarterly data on US output growth for the period 1960 to the most recent data from www.bea.gov....
-
This question asks you to examine the movements of investment and consumption before, during and after the recession of 2001. It also asks you to consider the response of investment and consumption...
Study smarter with the SolutionInn App