- id (int)
- A unique number to identify this person,
(You may use the array index for this.)
- gender (boolean)
- Use true for male, false for female.
- name (String)
- name of this person
- height (Float)
- height of this person (in inches)
- bmi (Float)
- BMI index (see below)
- born (int)
- The year this person was born (between 1920 and 2000).
- NOTE: You may create additional variables and methods, as necessary.
|
Write a 7-argument constructor method, to set all data variables.
Also write a constructor with only the first three arguments (id, gender, and name),
that randomly fills the other data variables (except bmi) as follows
- For year of birth, use a random number between 1920 and 2000.
- For height, use a random number between 60 and 76 for males, or between 56 and 72 for females.
- For weight, choose a random number from 120 to 200 for males, or from 100 to 180 for females.
Also recalculate the BMI.
|
|