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 Tri-State 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 $100,000.
The base monthly rate is $45.00. The monthly premium will be adjusted based on candidate demographic data and other factors. The Tri-State Product Analyst has provided you with the following adjustment (to the base monthly rate) business rules:
Category Adjustment in dollars
Non-smoker +0.00
Smoker +55.00
Female +0.00
Male +15.00
Age <25+0.00
Age 25 to <35+18.00
Age 35 to <45+23.00
Age 45 to <55+36.00
Age 55 to <65+51.00
Age 65 to <80+100.00
Age >=80 Not eligible
Low risk occupation -5.00
High risk occupation +42.00
Traffic tickets 0+0.00
Traffic tickets 1+5.00
Traffic tickets 2+9.00
Traffic tickets >2+19.00
Good health -6.00
Fair health +0.00
Poor health +60.00
In addition, if the applicant is in three of the following categories: smoker, high-risk occupation, more than 2 traffic tickets, and poor health, then add $65.00.
However, if the applicant is in three of the following categories: non-smoker, age <25, low risk occupation, 0 traffic tickets, and good health, then subtract $15.00.
You decide to create a class named RateEstimator to store and get/set all of the attributes, and you determine there need to be six attributes (demographic/personal data) as follows:
Attribute Type Value/Range
Smoker true/false True if smoker,
False if not
Gender character M or m; F or f
Age whole number Positive less than 80
High risk occupation true/false True if high risk,
False if not
Number of traffic tickets whole number >=0
Overall health text Good,Fair 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: 25
# of tickets: 1
Risky: false
Health: Good
Monthly premium: 57.0
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
1. 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.
2. You must use the provided BlueJ starter project and develop your solution using the BlueJ IDE.
3. Do NOT change the name, return type, or parameter order/type of any of the class or test class methods. These are used by Web-CAT to grade your submission, and you will end up losing points if they are changed.
4. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!