Question
Write a program in java. You are tasked with writing an application that will keep track of Insurance Policies. Create a Policy class called InsurancePolicies.java
Write a program in java. You are tasked with writing an application that will keep track of Insurance Policies. Create a Policy class called InsurancePolicies.java that will model an insurance policy for a single person. Use the following guidelines to create the Policy class: An insurance policy has the following attributes: o Policy Number o Provider Name o Policyholders First Name o Policyholders Last Name o Policyholders Age o Policyholders Smoking Status (will be smoker or non-smoker) o Policyholders Height (in inches) o Policyholders Weight (in pounds) Include a no-arg constructor and a constructor that accepts arguments (it must accept all necessary arguments to fully initialize the Policy object) Include appropriate setters and getters (i.e., mutator and accessor methods) for each field Include a method that calculates and returns the BMI of the policyholder* o BMI = (Policyholders Weight * 703 ) / (Policyholders Height2 ). Include a method that calculates and returns the price of the insurance policy* o The Insurance Policy has a base fee of $500 o If the Policyholder is over 50 years old, there is an additional fee of $50 o If the Policyholder is a smoker, there is an additional fee of $100 o If the Policyholder has a BMI of over 40, there is an additional fee calculated as follows: Additional Fee = ( BMI 40 ) * 50 *Note: this is a calculated amount based on some of the attributes above. Make sure to avoid having a stale value for this. See "Avoiding Stale Data" in Section 6.2 Demonstrate your Policy class by writing a Demo class called InsurancePoliciesDemo.java . The Demo class should ask the user to enter all necessary information, create a single instance of the Policy class using the constructor that accepts arguments, and then displays all of the information about the policy using the appropriate methods of the Policy class. See the Sample Input and Output below for how to format the input and output of the Demo class (make sure to match the wording and formatting exactly). Sample Input: Please enter the Policy Number: 1234 Please enter the Provider Name: State Farm Please enter the Policyholders First Name: John Please enter the Policyholders Last Name: Doe Please enter the Policyholders Age: 24 Please enter the Policyholders Smoking Status (smoker/non-smoker): non-smoker Please enter the Policyholders Height (in inches): 62.0 Please enter the Policyholders Weight (in pounds): 250.5 Sample Output: Policy Number: 1234 Provider Name: State Farm Policyholders First Name: John Policyholders Last Name: Doe Policyholders Age: 24 Policyholders Smoking Status: non-smoker Policyholders Height: 62.0 inches Policyholders Weight: 250.5 pounds Policyholders BMI: 45.81 Policy Price: $790.60
The program should consist of two classes. I got only the Demo program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started