You are on page 1of 1

សាកលវ ិទ្យាល័យភូ មិន្ភ

ទ ំ ពន េញ Java Programming
មហាវ ិទ្យយល័យវ ិស្វកមម ពោកគ្រូ៖ ពោ ស្ុខជា
ឆ្នំទ្យី២ ឆមាស្ទ្យី១ Lab 10

LAB 10: ITECalculator


In this lab, you will not add any new functionalities to ITECalculator but you need to
redesign some parts of your calculator by using OOP especially inheritance that we have
learned in the lecture.

A. Omit class NumberSystemConversion that you create in lab 5.

B. Create a new class named NumberSystem. This class will be used as a super
class. Please shift some code from your old class NumberSystemConversion to this
new class. You can add new fields and methods to this new class. Note: because
it is a base class, you should add fields and methods that can serve for all child
classes.

C. Create a new class named Binary and inherit from NumberSystem class. In this
class, it will handle all conversion from Binary to Octal, Decimal, and Hexadecimal.

D. Create a new class named Octal and inherit from NumberSystem class. In this
class, it will handle all conversion from Octal to Binary, Decimal, and Hexadecimal.

E. Create a new class named Decimal and inherit from NumberSystem class. In this
class, it will handle all conversion from Decimal to Binary, Octal, and Hexadecimal.

F. Create a new class named Hexadecimal and inherit from NumberSystem class. In
this class, it will handle all conversion from Hexadecimal to Binary, Octal, and
Decimal.

Note: You can shift your code that you wrote in lab 5, 6, 7 to the corresponding new classes
you created.

You might also like