Write a java program to simulate a car insurance We have a problem, which is calculating the insurance price at a unified price for all categories.to solve this problem I want to calculate the insurance price in addition to the factors in the uml. For example, if the individual's age is from 18-25, the insurance rate will increase by 1% over the basic price, as well as the type of car and the gender of the person who wants insurance, for example, if a man also increases 1 % and so are all the factors. If you cannot write the entire program, it is not a problem. Write at least the equations for calculating the insurance or half of the program also You can put random numbers and random prices.
Write a java
We have a problem, which is calculating the insurance price at a unified price for all categories.to solve this problem I want to calculate the insurance price in addition to the factors in the uml. For example, if the individual's age is from 18-25, the insurance rate will increase by 1% over the basic price, as well as the type of car and the gender of the person who wants insurance, for example, if a man also increases 1 % and so are all the factors. If you cannot write the entire program, it is not a problem. Write at least the equations for calculating the insurance or half of the program also You can put random numbers and random prices.
![Interface
Next meeting
Insurance company class
// data base
Contracts : car insurancel]
Cities : city[]
Accidents : Accident ]
Insurable
25 march
Have license (): String
Above age() : Boolean
Driver class
Age : int
License : String
// information
Jobs: Jobl]
Age cost: double []
Cars: carl] { cost for each car}
Cost per insurance tvoe:
doublel) { full , 3d party }
insurance type: Stringl] enum
Accidents cost limit: doublel]
Copayment: intl]
Owned car :car
Driving experiance : int
car insurance cass
Accident cost: int
driver : Driver
Car : Car
Marital status: String
Gender: String
insurance type: String
driving citv: City
policy date: Date
insurance cost: double
accidents historv: doublel)
Job : String
Insurance cost : car insurance(]
Cars : Car[)
Main ()
Create cites
1- While ( days counter
365)
2- Update situation
fincrease people in each
City dass
<<constructor>> generation
city, increase insurance
people
Accident percentage: int
GDP-int12-elerments}
Jobs: Stringl] {fix}
People : insurablel]
New day()
cost}
3- Generation random {
new contracts}
4- Generation of accidents
5- Calculate total profit
Car abstract class](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F624ccb4a-41a0-4c95-afbb-209df5b69419%2F42dbc4d8-2bcb-4589-b805-08ed7f799002%2F8uonpx6_processed.png&w=3840&q=75)
![<<constructor> generation
city, increase insurance
cost}
3- Generation random {
new contracts}
people
Accident percentage: int
GDP-int{12-elements}
Jobs: Stringl] (fix}
People : insurable]
New dav()
4- Generation of accidents
5- Calculate total profit
Car abstract class
car cost: double
Insurance cost : double
Accident cost: int
Insurance cost : car insurance
Milage : int
Model : int (10 years older)
Maker : String
History: String
Main() for testing
Accident class
Job class
Canlnvolved : Car]
date : Date
resPersentage : intI
Job name: String
Jobs cost: double
Van class
sedan class
000000 2000 2000 0 1500 1300 1200
Insurance cost = Driver + city + car
Sport car class](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F624ccb4a-41a0-4c95-afbb-209df5b69419%2F42dbc4d8-2bcb-4589-b805-08ed7f799002%2F5w5psoj_processed.png&w=3840&q=75)

Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









