I want to create a constructor for the job name and salary cost and then add the names of the jobs if it is an engineer  give it a default value engineer =50 ,doctor=80 ,pilot =70 or teacher =0 also if the job is a taxi or delivery,  calculating a random value for them by using this method public int randomRange(int start, int finish) {  Random r= new Random();  return start+r.nextInt(finish+1 -start);  }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

I want to create a constructor for the job name and salary cost and then add the names of the jobs if it is an engineer  give it a default value engineer =50 ,doctor=80 ,pilot =70 or teacher =0

also if the job is a taxi or delivery, 

calculating a random value for them by using this method

public int randomRange(int start, int finish) {
 Random r= new Random();
 return start+r.nextInt(finish+1 -start);
 }

Job class
Job name: String
Jobs cost: double
Transcribed Image Text:Job class Job name: String Jobs cost: double
Interface
Next meeting
Insurance company class
Insurable
25 march
// data base
Contracts : car insurance)
Cities : cityl)
Accidents : Accident
Have license (0: String
Above age(): Boolean
Driver class
Age : int
License : String
// information
Jobs: Jobl]
Age cost double ]
Cars: carll { cost for each car }
Owned car :car
Driving experiance : int
car insurance dass
Accident cost: int
Cost per insurance tvoe:
doublel) ( full, 3" party }
insurance type: Strinel] enum
Accidents cost limit: doublel
Copayment: int]
driver : Driver
Car : Car
Marital status: String
Gender: String
insurance type: String
driving citv: City
policy date: Date
Job : String
Insurance cost : car insurance]
Cars: Carl)
insurance cost: double
accidents historv: doublel)
Main ()
Create cites
1- While ( days counter
365)
2- Update situation
fincrease people in each
City dass
<<constructor>> generation
city, increase insurance
cost)
3- Generation random {
new contracts}
people
Accident percentage: int
GDP-intH12 elements
Jobs: Strinel] (fix}
People : insurablel]
New dav()
Insurance cost: double
4- Generation of accidents
5- Calculate total profit
Car abstract class
car cost: double
Accident cost int
Insurance cost: car insurance
Milaee : int
Model : int (10 years older)
Accident class
Job class
Caninvolved : Car)
date : Date
resPersentage : int
Maker : String
History: String
Mainl) for testing
Job name: String
Jobs cost double
Van class
sedan dass
000000 2000 2000 0 1500 1300 1200
Insurance cost = Driver + city + car
Sport car dass
Transcribed Image Text:Interface Next meeting Insurance company class Insurable 25 march // data base Contracts : car insurance) Cities : cityl) Accidents : Accident Have license (0: String Above age(): Boolean Driver class Age : int License : String // information Jobs: Jobl] Age cost double ] Cars: carll { cost for each car } Owned car :car Driving experiance : int car insurance dass Accident cost: int Cost per insurance tvoe: doublel) ( full, 3" party } insurance type: Strinel] enum Accidents cost limit: doublel Copayment: int] driver : Driver Car : Car Marital status: String Gender: String insurance type: String driving citv: City policy date: Date Job : String Insurance cost : car insurance] Cars: Carl) insurance cost: double accidents historv: doublel) Main () Create cites 1- While ( days counter 365) 2- Update situation fincrease people in each City dass <<constructor>> generation city, increase insurance cost) 3- Generation random { new contracts} people Accident percentage: int GDP-intH12 elements Jobs: Strinel] (fix} People : insurablel] New dav() Insurance cost: double 4- Generation of accidents 5- Calculate total profit Car abstract class car cost: double Accident cost int Insurance cost: car insurance Milaee : int Model : int (10 years older) Accident class Job class Caninvolved : Car) date : Date resPersentage : int Maker : String History: String Mainl) for testing Job name: String Jobs cost double Van class sedan dass 000000 2000 2000 0 1500 1300 1200 Insurance cost = Driver + city + car Sport car dass
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Math class and its different methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education