Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

PRLD5121_HOME EXAM

ST10252399

PRLD5121

BCAD1

7/5/2023
JOSHUA OLADIPO

I hereby declare that I did not plagiarise the content of this


assignment and that this is my own work.
Assignment submitted via SafeAssign: ☒(Tick the Box)
PRLD5121_HOME EXAM ST10252399

TABLE OF CONTENTS
QUESTION 1 ............................................................................................................. 2
Q.1.1) Identify and differentiate between the two programming models or
paradigms that will be considered for the development effort. Substantiate your
answer with examples related to the development of the application required by
the sports administrators. ....................................................................................... 2
Q.1.2) Explain how you will ensure that the application you develop will function as
intended before delivering it to the client. ............................................................... 3
Q.1.3) Name one tool that you can use to plan the logic for the application to be
developed for the sports administrators. ................................................................. 4
Q.1.4) Provide an example that will satisfy each of the following requirements. ..... 4
Q.1.4.1) Provide an example of a variable declaration that will store the number of
leave days applied for by a team player. ................................................................ 4
Q.1.4.2) Assume that the standard rate for a player (in any of the teams) is R75
000 a game. Write down the mathematical expression that will determine the
salary for a player based on the number of matches played in a given month. The
number of matches will be stored in a variable called “Matches”. ........................... 4
Q.1.4.3)................................................................................................................... 5
Q.1.4.4) State how you will write following statement as a comment in the
application. Calculate the player’s salary. ............................................................... 5
Q.1.5)...................................................................................................................... 0
QUESTION 2 ............................................................................................................. 1
Q.2.1)...................................................................................................................... 1
Q.2.2)...................................................................................................................... 2
QUESTION 3 ............................................................................................................. 3
Q.3.)........................................................................................................................ 3
QUESTION 4 ............................................................................................................. 4
Q.4.1)...................................................................................................................... 4
Q.4.2) Within the context of the Sports Administration application, describe one
example of a situation where overloaded methods could be used. ........................ 5
question 5................................................................................................................... 6
Q.5.1)...................................................................................................................... 6
Q.5.2) Explain the importance of implementing exception handling in the Sports
Administration application ....................................................................................... 7
REFERENCING LIST................................................................................................. 8

Page | 1
PRLD5121_HOME EXAM ST10252399

QUESTION 1
Q.1.1) Identify and differentiate between the two programming models or
paradigms that will be considered for the development effort.
Substantiate your answer with examples related to the development of
the application required by the sports administrators.
(Farrell, 2018), (GeeksforGeeks, 2019)
1. PROCEDURAL PROGRAMMING:
(GeeksforGeeks, 2019) Procedural programming can be characterized as a
programming paradigm built from structured programming and based on the notion
of calling process. Procedures, often known as routines, subroutines, or functions,
are essentially a set of computing processes to be completed(GeeksforGeeks, 2019)
Any given process may be invoked at any time throughout the process of execution
of a program, whether by other processes or by itself.

EXAMPLES:

• (Farrell, 2018)The creation of a function that prompts the user for the event to be
edited, obtains the event from the schedule, and enables the user to alter
information like the date, setting, or participants is a procedural method for
adjusting the details of an event. To complete the task, the function will go
through a set of stages.
• (Farrell, 2018)To add a new event to the schedule, a function may be written
using procedural programming. The function would ask for event information from
the user, check the data, and then add the event to the schedule data structure.
The focus is on outlining the process for include an event and carrying it out in a
certain order.
• (Farrell, 2018)A variety of reports may be produced using procedural
programming based on the scheduled events. A function that can create several
reports, such as a list of future events, a summary of events categorized by their
categories, and a report that emphasizes events with low participation, may be
developed by evaluating the event data. Every form of report adheres to a certain
procedure that has been properly thought out and put into place.

2. OBJECT-ORIENTED PROGRAMMING:
(GeeksforGeeks, 2019) Object-oriented programming can be characterized as a
programming model based on the object idea. Objects include attributes that hold
data and methods which include code. Programs for computers in object-oriented
programming are developed with the notion of objects which communicate with the
real world. The most common object-oriented programming languages are class-
based, which means that objects are instances of classes, which additionally define
their types.

Page | 2
PRLD5121_HOME EXAM ST10252399

EXAMPLES:

• (Farrell, 2018) An Administrator class can be created to handle administrative


functions within the application. For security reasons, this class may have
properties like the administrator's name, as well as username, and passcode.
It may include procedures for signing in, administering account usage,
providing rights, and managing operations particular to the program. The
system's administrators can be represented by objects of this type.
• (Farrell, 2018) To represent player’s competing in sporting events, a class
called "Player" might be developed. The class would provide methods for
getting and updating the players data as well as properties like age, name, as
well as performance statistics. Players linked to events may be managed and
tracked using objects of this type.
• (Farrell, 2018) You may define classes in a sports scoreboard application to
represent different user interface elements like buttons and data fields, and
checkboxes. Each control class can have unique attributes (including
variables such as size, location, and look) as well as techniques (like
managing input from users or rendering). A graphical user interface (GUI) for
the program may be created using these classes, which can be created as
objects and communicate with one another. This exemplifies the usage of
objects to represent and interact with components in a graphical system as
well as the idea of encapsulation.

Q.1.2) Explain how you will ensure that the application you develop will
function as intended before delivering it to the client.
(IBM, 2019)

• Evaluate the client’s needs: To clearly comprehend what the application


should do; I will first carefully evaluate the client's needs. This will aid in
describing the application's desired actions and capabilities.
• Bug fixing: Any problems or defects found throughout the testing rounds will
be noted and given a priority rating. The issues that arise will be fixed by the
development team, who will then retest the program to make sure they were
properly fixed.
• Unit testing: Developers utilize the approach of unit testing to examine the
individual parts or modules of an application. This helps identify and fix any
issues early in the development cycle. To verify the behaviour of the code,
this entails creating and running test cases.
• (SearchSoftwareQuality, n.d.) User Acceptance Testing (UAT): The
application will be sent to the customer for UAT after it satisfies the criteria
and pass internal testing. The program will be put to the test by the user or
end users in an actual-life situation to confirm its functioning and
effectiveness.

Page | 3
PRLD5121_HOME EXAM ST10252399

Q.1.3) Name one tool that you can use to plan the logic for the
application to be developed for the sports administrators.
(Farrell, 2018 pg. 17)
A flowchart is one tool that may be utilized to outline the logic for an application that
will be created for sports administrators. A flowchart is a diagram that shows the
phases or logic of an algorithm or procedure. You can pinpoint the many steps,
circumstances, and results that must be considered in the application by using a
flowchart. It simplifies task scheduling, delineates logical connections between
distinct components, and produces a visual depiction of the overall architecture of
the program. It can also be used to illustrate the flow of information, the order of
processes, and the conditions that must be met before certain actions can be taken.
By creating a flowchart, sports administrators may plan and construct the
application's logic in a logical and disciplined manner, guaranteeing that all important
features and choices are taken into consideration.

Q.1.4) Provide an example that will satisfy each of the following


requirements.
Q.1.4.1) Provide an example of a variable declaration that will store the
number of leave days applied for by a team player.
(Farrell, 2018)
num numberOfLeaveDaysApplied = 0

Q.1.4.2) Assume that the standard rate for a player (in any of the teams)
is R75 000 a game. Write down the mathematical expression that will
determine the salary for a player based on the number of matches
played in a given month. The number of matches will be stored in a
variable called “Matches”.
(Farrell, 2018)
Matches = 5
playerSalary = Matches * 75 000

Page | 4
PRLD5121_HOME EXAM ST10252399

Q.1.4.3)
(Farrell, 2018 pg. 64 - 66)

Application modules

login() schedulePlayer() approveLeave() determineSalary()

authenticateUsers() createSchedule() reviewRequests() getPlayerPerformance()

assignPlayers() deletePlayers() approveLeave() rejectLeave() calculateSalary()

updateSchedule() updateStatus() calculateBonus()

Q.1.4.4) State how you will write following statement as a comment in


the application. Calculate the player’s salary.
(Farrell, 2018)
//Calculate the player’s salary.

Page | 5
Q.1.5)
(Farrell, 2018, Chapter 3 pg. 84 - 114 )
PRLD5121_HOME EXAM ST10252399

QUESTION 2
Q.2.1)
(Farrell, 2018 pg. 91)

Page | 1
PRLD5121_HOME EXAM ST10252399

Q.2.2)
(Farrell, 2018)

Page | 2
PRLD5121_HOME EXAM ST10252399

QUESTION 3
Q.3.)
(Farrell, 2018 pg. 244 - 248)

Page | 3
PRLD5121_HOME EXAM ST10252399

QUESTION 4
Q.4.1)
(Farrell, 2018 pg. 379 - 403)

Page | 4
PRLD5121_HOME EXAM ST10252399

Q.4.2) Within the context of the Sports Administration application,


describe one example of a situation where overloaded methods could be
used.
(Farrell, 2018 pg. 410)
The scheduling module in the Sports Administration program is one place where
overloaded methods could be utilized. The program may need to handle several
matches or event kinds that call for various functionality and parameters. The
program can successfully manage diverse scheduling conditions by creating many
iterations of a single procedure utilizing various parameter combinations when
employing overloaded methods.
Take the createSchedule() function, for instance. To manage other sorts of events,
such as league games, friendlies, or training sessions, overload variants of this
system might be used. Each overloaded method might receive many event-specific
parameters, including team names, dates and times, locations, lengths of events,
and other information.
This strategy eliminates the requirement for distinct method names or unnecessary
branching inside a single method, allowing the application to offer specialized ways
customized to varied scheduling demands while still providing flexibility and
convenience to the users. In order to provide effective handling of various event
kinds in the Sports Administration system, overloaded methods improve the
application's ease of reading, maintenance, and effectiveness.

Page | 5
PRLD5121_HOME EXAM ST10252399

QUESTION 5
Q.5.1)
(Farrell, 2018 pg. 430 - 439 )

Page | 6
PRLD5121_HOME EXAM ST10252399

Q.5.2) Explain the importance of implementing exception handling in the


Sports Administration application.
(Farrell, 2018 pg. 489 – 493)
Exception handling helps with debugging and keeping the program up to date. When
exceptions arise, they might offer useful details about the origin and location of the
issue, making it simpler to find and correct errors. Furthermore, organized error
tracking and reporting are made possible via handling of exceptions, allowing
programmers to monitor and assess problems to make corrections in the future. A
better user experience is facilitated by exception handling. Users may be given
relevant error messages or alternative actions that direct them toward addressing
problems rather than experiencing cryptic error displays or unsuccessful
applications. This enhances usability and aids users in comprehending and resolving
any issues they may have when utilizing the program.

Page | 7
PRLD5121_HOME EXAM ST10252399

REFERENCING LIST
✓ Farrell, J. (2018). Programming logic and design, comprehensive. 9th ed. Boston:
Cengage Learning.
✓ GeeksforGeeks. (2019). Differences between Procedural and Object Oriented
Programming. [online] Available at: https://www.geeksforgeeks.org/differences-
between-procedural-and-object-oriented-
programming/#:~:text=Procedural%20programming%20is%20used%20for.
✓ IBM (2019). What is software testing? [online] Ibm.com. Available at:
https://www.ibm.com/topics/software-testing.
✓ SearchSoftwareQuality. (n.d.). What is User Acceptance Testing (UAT)? [online]
Available at: https://www.techtarget.com/searchsoftwarequality/definition/user-
acceptance-testing-UAT#:~:text=Writer%20and%20Editor-.

Page | 8

You might also like