Set A
Set A
Test Data:
a. -5 + 8 * 6
b. (55+9) % 9
c. 20 + -3*5 / 8
d. 5 + 15 / 3 * 2 - 8 % 3
2.Create a class 'Student' with three data members which are name, age and address.
The constructor of the class assigns default values name as "unknown", age as '0' and
address as "not available". It has two members with the same name 'setInfo'.
First method has two parameters for name and age and assigns the same whereas the second
method takes has three parameters which are assigned to name, age and address respectively.
Print the name, age and address of 10 students.
class Student {
String name;
int age;
String address;
public Student() {
this.name = "unknown";
this.age = 0;
this.address = "not available";
}
students[0].setInfo("Jack", 20);
students[1].setInfo("Oggy", 22, "123 Maple Street");
students[2].setInfo("Bheem", 19, "456 Oak Avenue");
students[3].setInfo("Doraemon", 21);
students[4].setInfo("Jon", 23, "789 Pine Road");