0% found this document useful (0 votes)
314 views2 pages

Mid Semester Test Question Paper ICT502 Sample

Uploaded by

Haiqa Suhail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
314 views2 pages

Mid Semester Test Question Paper ICT502 Sample

Uploaded by

Haiqa Suhail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Mid Semester Test Examination April 2024

VICTORIAN INSTITUTE OF TECHNOLOGY


MASTER OF INFORMATION TECHNOLOGY AND SYSTEMS
SEMESTER EXAMINATION: April 2024

Student ID:

UNIT CODE: ICT502 EXAM DATE: 18-04-2024 TIME: hh:mm PM

UNIT NAME: Object Oriented Programming

This exam paper is set for a Total of 20 Marks.


This paper consists of 4 Questions
Total Number of Pages in this Question Paper (including this page): 2 Pages

READING TIME: 5 Minutes


WRITING TIME: 45 Minutes
SUBMISSION TIME: 10 Minutes

INSTRUCTIONS TO CANDIDATES:
1. Write your Student ID in the box provided above.
2. Use the reading time to study the question paper but do not begin writing until
instructed.
3. Candidates may seek clarifications with invigilators/examiners during the reading time
only.
4. Candidates are not allowed to leave the examination room within the first 30 minutes of
the exam, or within the last 15 minutes of the exam.
5. Students should attempt ALL questions unless otherwise stated.
6. Write all your answers through LMS editor.

Unit Code: ICT502


Mid Semester Test Examination April 2024

Mid-Semester Sample Test Paper

Set 1 (45 mins to complete)

1. What is the value of variable a after the following statements are executed?

a = 38;
a = a + 52;
a = a * 3;
a = a / 4;
[2 marks]
2. Assuming that a Random object has been created called generator, what is the
range of the result of each of the following expressions?
generator.nextInt(50);
generator.nextInt(32) + 2; [2 marks]

3. Write a class named Book with fields for a book's title, author, and number of pages.
Include get and set methods for each field. Include an equals () method that
indicates two books are equal if they have the same title, author, and number of
pages. Write a toString() method to print the book's details. You need to write
two(2) constructors for this class: an empty constructor and a constructor to
initialize all fields. [10 marks]
4. Now write a testBook class to instantiate two books by following the information
below:
a. Instantiate book1 with no information. Set title to "The Great Gatsby", author
to "F. Scott Fitzgerald", and number of pages to 218 using the setter
methods.
b. Instantiate book2 by passing title, author, and number of pages of your
choice.
c. Print book1 and book2 information.
d. Compare book1 and book2 if they are the same or not. Use equals ()
method to compare and print the result.

[2 + 2 + 1 + 1 = 6 marks]

Unit Code: ICT502

You might also like