You are on page 1of 19

Maldives Business School Cover Page

ASSIGNMENT BRIEF
Bachelor’s Degree Year 2 IT

The student must fill the relevant parts of the following table.
Student Last Student Task
Student First Name Name ID No. Date submitted Date issued
Hussain Riyaz 5201 1 19.10.2022 July 2022
Statement of authenticity
I, the above-named student, hereby confirm that this assignment is my own work and not copied or plagiarized.
It has not previously been submitted as part of any assessment. All the sources, from which information has been
obtained for this assignment, have been referenced in the Harvard format. I further confirm that I have read and
understood the Maldives Business School rules and regulations about plagiarism and copying and agree to be
bound by them.

Assignment summary information


Unit Unit 19 Object Oriented Programming Modality OL
Specialization Core
Assignment type This is an individual assignment.
Tasks Submit on Do on
Task 1: Mid-Sem Report: LO3, LO4 15th-20th October 2022 NA
Task 2: End- Sem Exam: LO1, LO2. NA *
An extension must be applied for in writing by individual students and will only be granted
Extensions
for valid reasons. No extensions allowed for examination.
Late Late submissions will be marked for all grades but will incur a fine of MVR 250 per task.
submissions (report & examination).
Each report resubmission will be charged MVR 100 & re-sit/retake for examination will be
Resubmissions
charged MVR 250.
Assessor(s) Ms. Saumya Tripathi Internal verifier Prof. Sandeep Singh Sikerwar
* End Semester examination dates as per the schedule.

Assessor(s) please fill the table below AFTER the evaluation.


Assessment criteria Task Maximum Marks Marks Obtained IV Comments
3.1 2 12.5
3.2 2 12.5
4.1 2 12.5
4.2 2 12.5
1.1 1 12
1.2 1 12
2.1 1 16
2.2 1 10
Total Marks 100
Assessor’s Name Signature Date
__/__/__
This is the cover page for your assignment. Each task must have this cover page. A missing cover page will require you to
resubmit the task and a fee of MVR 100 will be charged. Read the document titled “Additional Guidance on Assignments” for
help on the general report format, general presentation format and referencing. End of cover page.

Statement of Grades:
Marks Representative Grade Grade Interpretation
85 & Above A* Higher Distinction
75 to 84 A Distinction
65 to 74 B Merit
50 to 64 C Pass
Below 50 F Fail

Page 1 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Object Oriented Programming
Hussain Riyaz
BIT/Bachelor of Information Technology
Maldives Business School
19th October 2022

3596 words

Abstract
This report identifies the basic concepts of OOP, and gives an overview of the features of object-oriented
programming, shows the object-oriented languages and environments. OOP helps us make an informed decision
in programming.

Page 2 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
TABLE OF CONTENTS

ASSIGNMENT BRIEF .......................................................................................................................................... 1


Abstract .................................................................................................................................................................... 2
TABLE OF CONTENTS ............................................................................................................................................ 3
Introduction .............................................................................................................................................................. 4
Question 1 ................................................................................................................................................................ 5
Question 2 ................................................................................................................................................................ 8
Question 3 ..............................................................................................................................................................10
Question 4 ..............................................................................................................................................................16
Conclusion and recommendations .........................................................................................................................19
References ..............................................................................................................................................................19

Page 3 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Introduction

Many Programmers has revealed that it makes a program easier to comprehend if they were able to take a bunch
of data and group it together with the functions. This kind of grouping data and functions is known as class and
object. Scripting programs by using classes is object-oriented programming

SCENARIO
You work as an application developer in a company. A client has approached your company and asked
your manager if your company could develop an employee management for his company. So, the
manager has asked you develop an OOP solution for the client.
You are supposed to develop a small application, which accepts employee no., employee name,
department, designation, basic salary and displays the following details as output:

• Emp No
• Emp Name
• Department
• Designation
• Calculated Professional Allowance
• Calculated House Rent Allowance
• Calculated Provident Fund Allowance
• Calculated Travel Allowance
• Calculated Gross Salary

Calculations

PROFESSIONAL ALLOW (PA) = 25% of Basic,


HOUSE RENT ALLOW (HRA) = 15% of Basic,
PROVIDENT FUND (PF) = 12% of Basic,
TRAVEL ALLOW (TA) = 7.50% of Basic.
Net Pay = Basic + PA + HRA + TA
Gross Salary = Net Pay - PF

You may assume that the values, for your reference a sample table with details is given below:
House Provident
Professional Travel Gross
Emp Emp Basic Rent Fund
Department Designation Allowence Allowence Salary
No Name Salary Allowence Allowence
(PA) (TA) (GS)
(HRA) (PFA)
Hussain
100 IT Inspector 120000 3000 1800 900 1800 15900
Riyaz
Mohamed
101 HR Sergeant 8000 2000 1200 600 1200 10600
Azim
Isham
102 IA Corporal 7000 1750 1050 525 1050 9275
Hameed
Aishath Sub
103 FCP 10000 2500 1500 750 1500 13250
Suzy Inspector

Page 4 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
REQUIRED
You are required to design and test an OOP solution. You are also required to prepare a test document on
it.

TASK 1: SOLUTION
Design and implement an OOP solution, test it, prepare a report on it titled “Designing and testing an
OOP solution.” In your report you must explain the control structures, objects, structures needed for
the design. Include in your report the test document you prepared and diagrams and pictures for the
purpose of illustration. It must not exceed 3,500 words.
The test document format is given below.
1. OOP test document
1. Objectives of the test document
2. Test planning
i. Test name
ii. Test date
iii. Expected results
iv. Actual results
v. Status
3. Test environment
4. Tools used to design and execute the test
5. Deliverables: Test results

Question 1
1. Critically review and test an object orientated programming solution. (3.1)
(12.5 Marks)
a. Critically review and test the OOP solution.
b. Prepare a test document.

Object-oriented programming is a programming standard that provides a way of structuring programs so that
properties and behaviors are bundled into individual objects.

Building blocks of OOP


• Classes
o classes are basically user defined data types
• Objects
o Objects are instances of classes created with specific data,
• Methods
o Methods represent behaviors. Methods perform actions; methods might return information
about an object, or update an object’s data. The method’s code is defined in the class definition.
• Attributes
o Attributes are the information that is stored and are defined in the Class template.

Class
-Dog

Attributes
-height
-weight
-food
Dog Objects
-Name

Methods
-Run
-Plat
-Eat

Page 5 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Four Principles of OOP
• Inheritance: child classes inherit data and behaviors from parent class
• Encapsulation: containing information in an object, exposing only selected information
• Abstraction: only exposing high level public methods for accessing an object
• Polymorphism: many methods can do the same task

Advantages of OOP
• Being faster and easier to execute;
• Providing a clear structure for a program;
• Making code easier to modify, debug and maintain; and
• Making it easier to reuse code.

The following tests were thoroughly carried out on the program. The table shows the test objectives, date of the
test, environment which the test was carried out, expected results and actual results.

Test Document
Test
Objectives of
Test Expected Actual environ
S.No the test Test Name Tools used Test results
Date results results ment
document

SN01 Check if the Startup 15.10.22 Loads the Loads the PC IDLE Shell Loads to the input screen of
program runs Test input input 3.10.4 the program when the
screen screen module is run or pressed F5

SN02 Check if the Input Input Test 15.10.22 All the All the PC IDLE Shell All the input were entered
is functioning well inputs inputs 3.10.4 successfully
functions functions
good good

SN03 Check if the Input Input Test 15.10.22 All the All the PC IDLE Shell All the string inputs
is excepting at different inputs string inputs 3.10.4 excepted numbers as inputs
strings or integers fields should excepted from the user
except only integer
related type values
of inputs
SN04 Check the Calculation 15.10.22 All the Calculation PC IDLE Shell Professional allowance,
calculations are Test 1 calculations s were 3.10.4 House rent allowance,
correct to be calculated Travel allowance,
Net salary,
correct correctly Provident fund and
Gross salary was calculated
accurately to the given
percentages

SN05 Check the Calculation 15.10.22 All the Calculation PC IDLE Shell Professional allowance,
calculations are Test 2 calculations s were 3.10.4 House rent allowance,
correct to be calculated Travel allowance,
Net salary,
correct correctly Provident fund and
Gross salary was calculated
accurately to the given
percentages

Page 6 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Below are the Screen Shots of the Calculations tests carried out. As you can see the Results are same as the
reference table above proving that the coding of the calculations is correct.

In the below screenshot we can see that the String inputs accepted numbers as inputs. This issue needs to be
attended by the programmer.

Page 7 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
The Below screenshot shows that integer inputs does not except strings as input. It is functioning the way
intended.

Question 2
2. Critically evaluate the environmental flexibility of programming (3.2)
(12.5 Marks)
a. Platform Independence

• Program independence
Program independence means that the software can run on a range of hardware platforms or software
architectures, requiring less planning and translation. For example, the Java programming language was designed
to run on multiple types of hardware and multiple operating systems. Groups with different types of computers
and devices will be able to write a specialized application once and have it be used by everyone, rather than
writing, distributing and maintaining multiple versions of the same program.

• Java for mobile application

Java is a versatile and powerful programming language that can be used for developing a wide range of
applications. It is platform-independent, which means it can be run on any platform, including Android and iOS.
An important note regarding iOS is that there is no Java Virtual Machine running on iPhones. However, you can
bypass this limitation by compiling the Java input to the Objective-C code.

Benefits of Java mobile application development

• Security and robustness


o Java has a range of essential security features that guarantee its robustness.

• Widespread popularity
o Most popular among the coders’ community which means that you have a chance to offshore the
entire Java development team and have a great selection of specialists to choose from.

• Built-in mobile development features


o Compared to other programming languages, Java is most suited for developing a high end mobile
application. It has numerous features that affect app performance, such as Just-In-Time
compilation and garbage collection.

• Relatively low investment


o Because of the wide spread coding community of java we have the options of choosing a cheaper
option for the project. For the company, it translates into better hiring options, reduced
recruitment costs, and better results for your application.
Page 8 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
• Community support
o Since the community of Java developers is huge developers can cooperate, use public libraries,
and make the most of community support when developing the mobile application.

• Embedded hardware programing in java (IOT devices)

IoT device embedded system is a combination of hardware and firmware with internet connectivity to perform
specific tasks. These devices transfer real-time data over the internet for a broader use case like monitoring,
tracking, analyzing, or more. Some of them are programmable or have fixed functionality. Examples include cars,
smartphones, industrial machines and medical equipment.

Standalone embedded systems do not rely on a separate host system. They perform a specialized task and isn’t a
part of a larger computing system. Examples include digital wristwatches and home appliances.

Real-time embedded systems provide a required output at predetermined time intervals, like a traffic control
system.

Embedded System Structure Diagram

Analog to Digital to
Sensor Processor Actuator
digital analog
Converter converter

Memory

Illustration by Hussain RIyaz

b. Identify and implement solution for error handling

There are three types of error that can occur when developing programs:

• Syntax errors
o A syntax error occurs when the code given does not follow the syntax rules of the programming
language. Like:
▪ misspelling a statement
▪ using a variable before it has been declared
▪ missing brackets

• Logic errors
o A logic error is an error in the way a program should function. The program can run but does not
do what it is supposed to do.
o Logic errors can be caused by the programmer:
▪ incorrectly using logical operators
Page 9 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
▪ incorrectly using Boolean operators
▪ unintentionally creating a situation where an infinite loop may occur
▪ incorrectly using brackets in calculations
▪ using incorrect program design

• Runtime errors
o A runtime error is an error that takes place during the running of a program.
o For example, writing a program that attempts to access the sixth item in an array that only
contains five items. A runtime error is probably going to crash the program.

Question 3
3. Create onscreen help to assist the users of a computer program. (4.1) (12.5 Marks)
a. Identify the necessary needs to create onscreen help to assist the users to use the designed OOP
solution.

The needs to create onscreen help are

• Help cuts down duplicative work


o Companies that use documentation to catalog past projects, collect research, and share decisions
benefit by reducing re-work that wastes precious time you could be utilizing elsewhere.

• Satisfied users
o The end-user experience is more successful when you have high-quality pictorial manuals. Poor or
dull user manuals will isolate the users, inadequate on-line help wastes a user's valuable time and
support that is not available immediately will frustrate your customers. As a result, your software
brand suffers.

• Longevity
o Your products will attain durability. Clearly written instructions along with onscreen
interpretations can prevent customer errors and make business processes more reliable. The
sooner your customer gains benefit from your product the longer they will use it and not be
hindered by it. As a result, your software brand profits.

b. Create onscreen help to assist the users to use the designed OOP solution.

This Onscreen Help Documentation is intended to assist the first time users of the OOP solution. For the OOP
solution to run on a Microsoft Windows 10 OS we will need to install python 3.10 for windows x64 bit.

Part 1 (Install Python)


Step 1: Download the Python Installer

Open the official Python website in your web browser. Navigate to the Downloads tab for Windows.

Choose the latest Python 3 release. In our example, we choose the latest Python 3.10 version.

Click on the link to download Windows x86 executable installer if you are using a 32-bit installer. In case your
Windows installation is a 64-bit system, then download Windows x86-64 executable installer.

Page 10 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Step 2: Run the Executable Installer

1. Once the installer is downloaded, run the Python installer.


2. Check the Install launcher for all users check box. Further, you may check the Add Python 3.10 to
path check box to include the interpreter in the execution path.

3. Select Customize installation. Choose the optional features by checking the following check boxes:
4. Documentation
5. pip
6. tcl/tk and IDLE (to install tkinter and IDLE)
7. Python test suite (to install the standard library test suite of Python)
8. Install the global launcher for `.py` files. This makes it easier to start Python
9. Install for all users.
Page 11 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
10. Click Next.

11. This takes you to Advanced Options available during the installation of Python. Select the Install for all
users and Add Python to environment variables check boxes. Or you can select the Associate files with
Python, Create shortcuts for installed applications and other advanced options. After selecting the
advanced options, click Install to start installation.

12. After the installation is over, you will see a Python Setup Successful window.

Page 12 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Step 3: Verify the Python Installation

You have now successfully installed Python 3.10.8 on Windows 10. You can verify if the Python installation is
successful either through the command line or through the IDLE app that gets installed along with the installation.
Search for the command prompt and type “python”. You can see that Python 3.10.8 is successfully installed.

Another way to search for python is from the start menu. Enter “Python” in the start menu and clicking on IDLE
(Python 3.1.8 64-bit).

Part 2 (Running the OOP Solution)


Step 1. Copy the provided OOP solution (Python file: EMS_V2.py ) to the desktop
Step 2. Right click on the file, select “Edit with IDLE”→Edit with IDLE 3.10(64-bit)

Page 13 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Step 3. The IDLE 3.10(64-bit) will open the python file to show the coding of the program. As in the below
screenshot.

Step 4. To run the program press “Run” tab then select “Run Module”. (Shortcut: F5)
Step 5. You will be taken to an IDLE Shell 3.10.8 window, where you should enter the relevant
information regarding the employee. (An example is shown below)

Page 14 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Step 6. After entering all the information and press enter key, the program will calculate the following
o PROFESSIONAL ALLOW (PA) = 25% of Basic,
o HOUSE RENT ALLOW (HRA) = 15% of Basic,
o PROVIDENT FUND (PF) = 12% of Basic,
o TRAVEL ALLOW (TA) = 7.50% of Basic.
o Net Pay = Basic + PA + HRA + TA
o Gross Salary = Net Pay - PF

• Then the following results are displayed (as shown in the figure below)
o Emp No
o Emp Name
o Department
o Designation
o Calculated Professional Allowance
o Calculated House Rent Allowance
o Calculated Provident Fund Allowance
o Calculated Travel Allowance
o Calculated Gross Salary

Calculations used in the program

PROFESSIONAL ALLOW (PA) = 25% of Basic,


HOUSE RENT ALLOW (HRA) = 15% of Basic,
PROVIDENT FUND (PF) = 12% of Basic,
TRAVEL ALLOW (TA) = 7.50% of Basic.
Net Pay = Basic + PA + HRA + TA
Gross Salary = Net Pay - PF

Page 15 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Step 7. If you need to change any values from the calculations, please contact our company hotline or
send a mail regarding the issue.
Step 8. To do the calculations for another employee restart from Step 4 of Part 2 (Running the OOP
Solution)

Please reach out if you need any assistance. Thank you for using our program.

Question 4
4. Create documentation for the support and maintenance of a computer program. (4.2)
(12.5 Marks)
a. Identify following needs to create documentation for the support and maintenance:

i. Install tool
The following instructions explains how to install Python 3 on a Windows Computer

System requirements to Install Python:

o OS: Windows 7 to 11, with 2GB RAM (4GB preferable)


o You have to install Python 3.10 and related packages, please follow the installation instructions given
below as per your operating system.

The procedure to install Python 3 on Windows OS:

Install Python 3.10:

1. To follow the installation, you will need an internet connection.


2. Visit https://www.python.org/downloads/windows/
3. Locate Windows x86-64 executable installer for 64 bits OS and Windows x86 executable installer
for 32 bits OS
4. Click on the located installer file to download.
5. After download completes, double click on the installer file to start the installation process.
6. Follow the instructions as per the installer
7. Important Note: After double clicking the installer, check mark the option “Add Python 3.10 to
PATH”

Check if Python is Installed Correctly:

1. Open the cmd window


2. Run the command “python --version” or “python3 --version” in the cmd window and press Enter.
3. You should get an Output Python 3.10.8 (or an output resembling this)

ii. Edit program using tools


To edit the provided program, Python 3.10 IDLE is required.

Page 16 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
iii. Code
1. The client wants to add new feathers in the program
2. The code is modified according to the client requests
3. The new program is handed over to the client
4. The client updates the old version of the program

b. Create documentation for the support and maintenance of designed OOP solution.

Maintenance and Support Documentation includes System Maintenance Plans, System Log Book, Monthly
Maintenance and Activity Reports, Root Cause and Resolution Reports, and Design Documents.

The client has asked to modify our program so that it is more user friendly and make a GUI for the program. The
following documentation is for the new Graphic User Interface of the Program.

Project Modification of Program EMS_V2.py


Purpose: Create a GUI for the program EMS_V2.py
Program Environment: Microsoft Windows 10
Requirements:

• The GUI should be executable on Windows 10 Operating Systems


• It must consist all the calculations of old program
• Must display all the calculated results

Intended Audience:

• ABC company employees

Proposed GUI for the Program EMS_V3.py

Page 17 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Purpose of Program Modification

Clint needed a The New version of the Program will be user friendly and is open for more modification in the
future.

Technical Details

The new program was built using Python and the PySimpleGUI package.

Why PySimpleGUI was chosen for the program

• Single package dependency


o does not require any other packages to be installed.
• The same GUI program can be executed on multiple GUI platforms
o including a web browser
o no need to change the source code

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

Project Cost Estimation


Project Title: Cost Estimation of Program EMS_V3.py
Program Development Costs Time (hrs) Cost
Estimates Development costs
Hours needed 840
Average cost per hour $50
Estimated total costs $6000
Estimated Software costs & development time (40-hour weeks)
Analysis 1 week (168hrs)
Design 1 week (168hrs)
Testing 1 week (168hrs)
Coding 1 week (168hrs)
Documentation 1 week (168hrs)
Estimated hourly wage of engineer (per hour) $30
Estimated total cost $7000
Equipment costs
Electricity cost per day $50
Total amount of days needed 35 days $1750
Total costs of Program development $14880
------------------------------------------------------------------------------------------------------------------------------------------------------

As this is a small program I have mentioned only 2 types of documentations. There are many more types of
documentations that is required for a larger program. Some of the documentations include:

• Planning documentation.
• Estimate documentation.
• Standards documentation.
• Metrics documentation.
• Scheduling documentation.
• System documentation.
Page 18 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT
Conclusion and recommendations
In preparation of this report I have gained a deeper understating of object-oriented programing concepts. It
makes the coding easier and understandable for the programmer. I have made an OOP solution for the scenario
and modified the program later according to the client. Onscreen help and related documentations are also
included.

References

• https://www.freecodecamp.org/news/what-is-object-oriented-programming/
• https://www.python.org/
• Python for Dummies 1st Edition

Page 19 Object Oriented Programming Hussain Riyaz (Student ID:5201) Bachelor’s Degree Year 2 IT

You might also like