Question: Show me the steps to solve So far so good. Now the Tri - State Financial Services management wants you to create a mechanism to
Show me the steps to solve So far so good. Now the TriState Financial Services management wants you to create a mechanism to generate a Term Life insurance quote. A Term Life policy covers the beneficiary or beneficiaries of the policy holder for a set period of time. Unlike a Whole Life policy, a Term Life policy is not a financial investment vehicle; it is simply a contractual agreement to pay the beneficiaries of the policy the face value in the event that the policyholder dies during the time period of the policy.
Demographic data will be fed into the program, and a monthly rate premium will be generated. For the purpose of the initial prototype of this rate generator, the face value of the policy will be limited to $
The base monthly rate is $ The monthly premium will be adjusted based on candidate demographic data and other factors. The TriState Product Analyst has provided you with the following adjustment to the base monthly rate business rules:
Category Adjustment in dollars
Nonsmoker
Smoker
Female
Male
Age
Age to
Age to
Age to
Age to
Age to
Age Not eligible
Low risk occupation
High risk occupation
Traffic tickets
Traffic tickets
Traffic tickets
Traffic tickets
Good health
Fair health
Poor health
In addition, if the applicant is in three of the following categories: smoker, highrisk occupation, more than traffic tickets, and poor health, then add $
However, if the applicant is in three of the following categories: nonsmoker, age low risk occupation, traffic tickets, and good health, then subtract $
You decide to create a class named RateEstimator to store and getset all of the attributes, and you determine there need to be six attributes demographicpersonal data as follows:
Attribute Type ValueRange
Smoker truefalse True if smoker,
False if not
Gender character M or m; F or f
Age whole number Positive less than
High risk occupation truefalse True if high risk,
False if not
Number of traffic tickets whole number
Overall health text GoodFair or Poor
You reason that you'll have one constructor with no parameters and another constructor that takes in each of the six attributes of demographic data, a get and set method for each attribute, and a calcMonthlyRate method to return the monthly rate calculation. Finally, you'll create a toString method to display the attributes and rate for a given object in the following format:
Policy quote information:
Smoker: false
Gender: M
Age:
# of tickets:
Risky: false
Health: Good
Monthly premium:
Next, you determine that the calculations that adjust the rate for each of the six demographic attributes and the final "attribute set" adjustment seven total conditional calculation methods should be in a separate utility class named RateUtility. These methods will be static methods, so they will be called on the class name rather than on an object of a class, just as one would call a method of the standard Java API Math class. The RateEstimator method calcMonthlyRate will call these static methods.
You "roll up your sleeves," knowing that the challenging part of this prototype will be the calcMonthlyRate method and setting up the tests in the JUnit class.
Assignment
A starter BlueJ project will be provided to you. You will complete the RateEstimator and RateUtility classes and the corresponding RateEstimatorTest and RateUtilityTest. You will need to complete and compile the classes following any guiding comments within the code and meeting requirements described in this write up
You must use the provided BlueJ starter project and develop your solution using the BlueJ IDE.
Do NOT change the name, return type, or parameter ordertype of any of the class or test class methods. These are used by WebCAT to grade your submission, and you will end up losing points if they are changed.
Each constructor and method in a class should have a corresponding unit test method. Besides serving to verify that your code is accomplishing what you intended, writing unit test methods helps you understand how the objects should behave how the methods create, access and mutate the object, or in the case of the utility class, the values that are returned when the static methods are called That is writing the test methods first helps guide your class coding efforts.
Follow these steps to complete this assignment:
a Review the first JUnit test method, completing the code if necessary. Note that proper testing includes making manual calculations to verify that expected values for a method action are equivalent to actual results.
b Once you feel the unit test method is a valid and robust test of the methods expected behavior
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
