0% found this document useful (0 votes)
86 views1 page

Test 1

This document contains an exam for an Object Oriented Programming class, with 8 questions covering topics like advantages of OOP, access modifiers, message passing, creating objects with attributes, writing for and do-while loops, creating classes for shapes with methods to calculate volume and area, and about accessors and mutators.

Uploaded by

David Kaaya
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views1 page

Test 1

This document contains an exam for an Object Oriented Programming class, with 8 questions covering topics like advantages of OOP, access modifiers, message passing, creating objects with attributes, writing for and do-while loops, creating classes for shapes with methods to calculate volume and area, and about accessors and mutators.

Uploaded by

David Kaaya
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

DAR ES SALAAM INSTITUTE OF TECHNOLOGY

DEPARTMENT OF COMPUTER STUDIES

CLASS: BENG10 CO OBJECT ORIENTED PROGRAMMING


TEST 1

1. List several advantages of OOP over other programming paradigms

2. Differentiate Private, Protected and Public.

3. What is message-passing as far as OOP is concerned.

4. For a ready made class called Student with attributes: name as String,
age as integer, RegNo as String; write a statement to create an
object for this class and assign values to its attributes.

5. Write a short FOR loop statement to count down from 10 to 0.

6. Write a DO-WHILE loop statement which will receive user input and
write it back to screen until the value -1 is specified by the user

7. Create two classes: Sphere and Cylinder and specify appropriate


attributes and define methods for area and volume. Create another
class (give it a name of your choice) with main function and use it to
find volume and area of both sphere and cylinder.

8. What are accessors and mutators? What are the uses and advantages
of accessors and mutators

You might also like