You are on page 1of 1

Tutorial 6 Introduction to object oriented programs

1 Description
In this tutorial, you will be introduced to the key concepts of an OOp through a number of “design”
exercises.

Note that the term “design” here refers only to the initial conceptual design of a program. The concrete
design will be studied next week. The main objective here is for you to become familiar with the key
OOp concepts, namely class and object. You will identify class or classes that are needed to describe
the concepts needed in an OOp. You then draw up the shape of each class using the UML class
notation. This must include any attributes and operations that the class may have.

2 Tasks
1. The greeting conversation program discussed in the lecture now needs to capture and process
data about mobile phones. A mobile phone contains data about manufacturer name and the
phone model. For example, the phone Samsung Galaxy 3S, GT-55360 has manufacturer name
“Samsung” and the model “GT-55360”. A mobile phone can perform two actions: one is to
change the model and the other is to record the name of a person.
Draw a design diagram for phone.
2. Extend the greeting conversion program further to capture data about which person owns which
phone. For example, the program should be able to capture the fact that a person named “Duc”
owns the Samsung phone mentioned in the previous task.
Think of at least two ways in which you can design this new requirement. Draw a suitable
design diagram for each.
3. In this task, you will design an object oriented program for the procedural program Arrays that
you wrote in a previous tutorial. In this OOp, which is called Array, an Array object has its
state set to an array of integers. Each object can perform the following actions upon this array:
a) count the number of elements that are negative
b) find the minimum element
c) determine whether the array is in ascending order
d) return the length of the array
e) compute the frequencies of each element of the array
Draw a design diagram for Array.
4. What are the benefits of the OOp Arrays that you designed over the procedural version?

3 Submission
Submit your report to the home work submission box of this tutorial on the FIT portal. Name the file as
follows: student-id_class_hwk6.zip, where student-id is your student id, class is the code of the class
that you attend.

PR2 Page 1 2019

You might also like