Professional Documents
Culture Documents
Assignemnt 1 (Tsdl-Java) : A-08 - Kaushiki - Kulakarni
Assignemnt 1 (Tsdl-Java) : A-08 - Kaushiki - Kulakarni
ASSIGNEMNT 1(TSDL-JAVA)
Q. Create a class Person and add the following data members to it: Name, height, weight, age,
dailyExercise(yes/no).
fitnessLevel(age, dailyExercise, BMI): Based on the person's age and whether he/she exercises or
not, print fitnessLevel as output. E.g. if age < 50, dailyexercise=true and BMI < 25, then the person is
fit.
In your main program, create an instance of Person class, call both the functions and demonstrate their
behavior by providing different param values. i.e. call the functions multiple times with different
values.
Code:-
import java.util.Scanner;
class Person{
double height;
double weight;
int age;
int dailyExercise;
Output:-