Sei sulla pagina 1di 2

Java Assignment 1 : 

● Create ​
Person class​
 with following properties 
○ String firstName; 
○ String lasttName; 
○ int age; 
○ String address; 
 
○ setPersonInfo(String fName, String lName, int age, String address); 
// this function will set values to varibales 
 
○ getPersonInfo(); 
// this function will print data of each Personal class object 
 
● Create ​
class Student​
 which will extends Person class with following properties 
○ String standard;​  // eg. 1st, 2nd...  10th 
○ int rollNo; 
 
○ setStudentInfo(String fName, String lName, int age, String address, 
String standard, int rollNo);  
// this function will set values to varibales 
// call setPersonInfo() function inside setStudentInfo() to set values of 
firstName, lastName, age and address 
 
● getStudentInfo(); 
// this function will print data of each Student class object 
// call getPersonInfo() function inside getStudentInfo() 
 
 
● Create ​
class Teacher​
 which will extends Person class with following properties 
○ String[] Subjects; ​
 // Array of string which will store subject teached by that 
teacher 
○ int teacherNo; 
 
○ setTeacherInfo(String fName, String lName, int age, String address, 
String[] subjects, int teacherNo); 
// this function will set values to varibales 
// call setPersonInfo() function inside setTeacherInfo() to set values of 
firstName, lastName, age and address 
 
○ getTeacherInfo(); 
// this function will print data of each Teacher class object 
// call getPersonInfo() function inside getStudentInfo() 
 
 
● Create class School with main method into it. 
○ Inside main method create 1 object of Student class. 
○ Create 1 object of Teacher class. 
○ Set and get data for both the objects. 
 

Java Assignment 2: 
● Create class Calculator 
○ Add basic functionality of calculator Add, Sub, Multiply, divide. 
○ Above functionality should work on following data types: int, float, 
double,string. 
○ Create main class in calculator create one object of it and call these functions 
with different data. 
 
 

Potrebbero piacerti anche