Professional Documents
Culture Documents
01
Total Marks: 20
Semester: Fall 2022
Compiler Construction CS506 Due Date: 5th Dec, 2022
Instructions:
Please read the following instructions carefully before submitting assignment. It should be clear that
your assignment will not get any credit if:
Objectives:
The objective of this assignment is to provide hands-on experience of Java Programming concepts
including:
attributes (id, name and program) and methods of constructors, getters, setters and print etc. Test class
will have the main method in which you are required to create four objects of Student class and store
them in an array. You have to write code for error exception handling as well in case if the array index
Detail:
Student class will have three attributes (id, name and program).
1. Default constructors: If an object of Student class is created without passing any parameter
default constructor should be executed and set the values of attributes (id, name, and program)
constructor will initialize the data members with the given values.
If the first two characters of the program string for example BS does not match the first two
It should have getter and setter functions to get or set the values of any one attribute.
print function of Student class should display the students object data store in the array list.
Test class will have the main method in which you are required to create four objects of
First object should be without providing the parameters so it should call the default
constructor.
Display the data of all the four students using for loop with one more index i.e 0,1,2,3,4. On
index 4, the Index out of Bounds Exception should be displayed.
BEST OF LUCK