Sie sind auf Seite 1von 5

CAUTION: This is just a SAMPLE and for your practice only.

There is no guarantee about the actual question pattern you are going to get during exam.

Total Marks: 100; Duration: 2 hours


1) [ Answer following conceptual questions x X y marks = xy marks]
a) Xxxxxx
b) Xxxxxx
c) Xxxxxx
d) Xxxx
e) Xxxxxx

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2) Consider a FXML application simulating part of IRAS: [xx marks]


➢ Following classes represents MODEL classes of your application:
abstract class User { N/A
protected int id; protected String name, email, mobile;
abstract public void setInfo(); abstract public void showInfo();
}

Concrete class Admin (subclass of User)


xx marks
Additional private fields: designation, salary
• public static void createNewStudent(//receives parameters from addStudBtnOnClick) {…} xx marks
//this will create a Student instance and add/append it to students.bin binary file
• public static void offerACourse(//receive parameters from offerCourseBtnOnClick) {…} xx marks
//this will write/append OfferedCourse details to offeredCourses.txt text file separated by ”,”
one offered course per line as follows: “courseID,courseTitle,section,semester,year,capacity”
• Overridden methods xx marks
(Where ever necessary, methods of the class should have appropriate exception handling)

Concrete class Student (subclass of User) xx marks


Additional private fields: cgpa, dept xx marks

• void registerACourse(//parameters from registerCourseBtnOnClick) {…}


//this will create a RegisteredCourse instance and add/append it to the regCourses.bin file xx marks

• public ObservableList<RegisteredCourse> getRegCourseList( ) {…} xx marks


//will open regCourses.bin file and return an ObservableList of registered courses of the
//client student only (to the onClick controller method to update FXML scene view)
• Overridden methods… xx marks
(Where ever necessary, methods of the class should have appropriate exception handling)
Concrete class RegisteredCourse xx marks
Private fields: studID, courseID, semester, year, section xx marks

• Public RegisteredCourse(//parameterized constructor) {…} xx marks


//this will populate fields of a RegisteredCourse instance
• Int getStudID() (//returns student id of the client RegisteredCourse instance} xx marks

➢ Also, there are Scenes, as follows:


▪ After successful login as admin an AdminScene.fxml instance will be visible to your Stage. MenuItems of
AdminScene are:
• addStudMenuItem (MenuItem):
▪ By clicking addStudMenuItem, addStudScene (Scene) will be visible at the center of BorderPane
(called adminSceneBorderPane):

Click to enter Student ID… → idTxt (TextField)


Click to enter Student name… → nameTxt (TextField)
Select your department → deptCombo (ComboBox)
Click to enter email… → emailTxt (TextField)
Click to enter mobile number… → mobileTxt (TextField)
Click to enter cgpa… → cgpaTxt (TextField)
Add the Student → addStudBtn (Button)
Close → closeBtn (Button)
Write addStudBtnOnClick() method of appropriate controller class [x marks]
(you need to ensure that the given student id is an unique & valid id)

• offerCourseMenuItem (MenuItem):
▪ By clicking offerCourseMenuItem, offerCourseScene (Scene) will be visible in a NEW Stage:

Select courseID → courseCombo (ComboBox)


courseLbl (Label) → will show title of the selected course
Select semester → semesterCombo (ComboBox)
Click to enter year… → yearTxt (TextField)
Click to enter section… → sectionTxt (TextField)
Offer the Course → offerCourseBtn (Button)
Write appropriate initialize() method of appropriate controller class [xx marks]
Write offerCourseBtnOnClick() method of appropriate controller class [xx marks]
▪ After successful login as student, a StudentScene.fxml instance will be visible to your Stage. MenuItems of
your StudentScene are:

• registerCourseMenuItem (MenuItem):
▪ By clicking registerCourseMenuItem, regCourseScene (Scene) will be visible at the center of
BorderPane (called studentSceneBorderPane).
Here, you need to draw the regCourseScene.fxml PREVIEW along with appropriate fxID of all the
controls and write necessary …OnClick() controller methods. [xx marks]
Write appropriate initialize() method of appropriate controller class [xx marks]

• showRegCoursesMenuItem (MenuItem):
▪ By clicking showRegCoursesMenuItem, showRegCoursesScene (Scene) will be visible to a new Stage:

Select studentID → studCombo (ComboBox)


courseTbl (TableView) → will show registered courses of selected student
courseID, semester, year, section are the ColumnView fxIds of courseTbl
Load all registered courses… → showRegCoursesBtn (Button)

Write appropriate initialize() method of appropriate controller class [xx marks]


Write showRegCoursesBtnOnClick()method of appropriate controller class [xx marks]

Hint: open students.bin to get the Student instance representing the selected student ID. Then, use
that instance as client to call getRegCourses() method of Student class. Finally use the returned
ObservableList from getRegCourses() method to populate the table rows.
3) Write a COMPLETE java program to implement the following class-diagram. Your main() method should
have menu-based option to perform operations to various types of objects.

4) Consider a java console application for the following:


▪ Following are the fields of your public class:
▪ Int row; // gets no of rows from user (<= 10000)
▪ Int col; // gets no of columns from user (<= 10000)
▪ Int upperLimit; // gets upper limit of matrix element’s value from user
▪ String fileName1, fileName2, fileName3
▪ Menu option - 1: Generate Matrix files
• Selecting this option will proceed to get two text file names from user in fileName1 & fileName2 for storing
two randomly generated matrices.
▪ At this point, you need to create first two files representing randomly populated matrices. First line
of those files will have two integers separated by space (no of rows & no of columns). Subsequent
lines will represent rows of those matrix values (separated by space).
▪ Upon successfully writing each file, a notification message will be displayed.
▪ Menu option - 2: Generate multiplied Matrix file
• clicking this option will do the following:
▪ If fileName1 & fileName2 are null, show some error message.
▪ Else If (noOfColsOfFile1 != noOfRowsOfFile2), then also show some error message.
▪ Otherwise, ask third text file name from user in fileName3 to store the multiplied matrix. At this point,
you need to read the source matrices from first two files, multiply them and write the multiplied
matrix into the third file.
5) Write necessary Java classes for the following console application:
a) There is a method of Test class called readAndLoad which reads UgStudent or PgStudent information from user
for N students (N is a user input and ensure that N is >0 and <=45) and stores them in an ArrayList of Student
objects called StudArray. Note that UgStudent & PgStudent are subclasses of Student class. Now, if same ID is
given by user for two students, a custom exception MUST be thrown to display custom message (i.e. you need
to define your own exception class).
b) There is another method called scanStudArray to go through the loaded StudArray and copy student cgpa values
into an array of ArrayList (s) of floats named cgpaFrequency [SIMULATING 2D ARRAY], where
i) First element of cgpaFrequency will have all the cgpa (s) <2.0
ii) Second element of cgpaFrequency will have all the cgpa (s) >= 2.0 and <3.0
iii) Third element of cgpaFrequency will have all the cgpa (s) >= 3.0
c) The third method called displayCgpaFrequency will display cgpaFrequency in 2D format
WRITE Student, UgStudent & PgStudent classes with appropriate fields & method prototypes
WRITE Test class with appropriate fields
WRITE readAndLoad method of Test class
WRITE scanStudArray method of Test class
WRITE displayCgpaFrequency method of Test class
WRITE subclass of Exception class called MyException

***********************************
***** Happy coding & best of luck ****
***********************************

Das könnte Ihnen auch gefallen