Professional Documents
Culture Documents
E194197 1690568405907 289937 Programming
E194197 1690568405907 289937 Programming
E194197 1690568405907 289937 Programming
Mrs.Darshani
1
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Unit(s)
Assignment title
Student’s name
2
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Do the assessment criteria awarded match
those shown in the assignment brief?
Y/N
Y/N
3
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
• Identifying opportunities for Y/N
improved performance?
• Agreeing actions?
Y/N
4
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Date
5
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Confirm action completed
Give details:
Internal Verifier
signature
6
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Date
Programme Leader
signature (if required)
Date
7
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
8
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Higher Nationals - Summative Assignment Feedback Form
Submission Date
9
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Re-submission Date submission
Assessor Feedback:
LO1. Define basic algorithms to carry out an operation and outline the process of programming an application.
LO2. Explain the characteristics of procedural, object-orientated and event-driven programming, conduct an analysis of a su
Integrated Development Environment (IDE).
10
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
M2
D2
LO4. Determine the debugging process and explain the importance of a coding standard.
11
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Grade: Assessor Signature: Date:
Resubmission Feedback:
12
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
* Please note that grade decisions are provisional. They are only confirmed once internal and external moderation has taken
place and grades decisions have been agreed at the assessment board.
Assignment Feedback
Action Plan
Summative feedback
13
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Feedback: Student to Assessor
14
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Assessor Date
signature
Student Date
signature
15
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Computing
16
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
General Guidelines
1. A Cover page or title page – You should always attach a title page to your assignment.
Use previous page as your cover sheet and make sure all the details are accurately
filled.
2. Attach this brief as the first section of your assignment.
3. All the assignments should be prepared using a word processing software.
4. All the assignments should be printed on A4 sized papers. Use single side printing.
5. Allow 1” for top, bottom , right margins and 1.25” for the left margin of each page.
1. The font size should be 12 point, and should be in the style of Time New Roman.
2. Use 1.5 line spacing. Left justify all paragraphs.
3. Ensure that all the headings are consistent in terms of the font size and font style.
4. Use footer function in the word processor to insert Your Name, Subject, Assignment
No, and Page Number on each page. This is useful if individual sheets become detached
for any reason.
5. Use word processing application spell check and grammar check function to help editing
your assignment.
Important Points:
1. It is strictly prohibited to use textboxes to add texts in the assignments, except for the
compulsory information. eg: Figures, tables of comparison etc. Adding text boxes in the
17
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
body except for the before mentioned compulsory information will result in rejection of
your work.
2. Carefully check the hand in date and the instructions given in the assignment. Late
submissions will not be accepted.
3. Ensure that you give yourself enough time to complete the assignment by the due date.
4. Excuses of any nature will not be accepted for failure to hand in the work on time.
5. You must take responsibility for managing your own time effectively.
6. If you are unable to hand in your assignment on time and have valid reasons such as
illness, you may apply (in writing) for an extension.
7. Failure to achieve at least PASS criteria will result in a REFERRAL grade .
8. Non-submission of work without valid reasons will lead to an automatic RE FERRAL. You
will then be asked to complete an alternative assignment.
9. If you use other people’s work or ideas in your assignment, reference them properly
using HARVARD referencing system to avoid plagiarism. You have to provide both in-
text citation and a reference list.
10. If you are proven to be guilty of plagiarism or any academic misconduct, your grade
could be reduced to A REFERRAL or at worst you could be expelled from the course
Student Declaration
I hereby, declare that I know what plagiarism entails, namely to use another’s work and to
present it as my own without attributing the sources in the correct way. I further understand
what it means to copy another’s work.
18
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
5. I acknowledge that the attachment of this document signed or not, constitutes a binding
agreement between myself and Edexcel UK.
6. I understand that my assignment will not be considered as submitted if this document is
not attached to the attached.
E194197@esoft.academy 28/07/2023
Student’s Signature: Date:
(Provide E-mail ID) (Provide Submission Date)
19
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Higher National Diploma in Computing
Assignment Brief
20
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Issue Date 19/04/2023
Submission Format
1. Written Report
This submission is in the form of an individual written report. This should be written in a concise, formal
business style using single spacing and font size 12. You are required to make use of headings, paragraphs
and subsections as appropriate, and all work must be supported with research and referenced using the
Harvard referencing system. Please also provide a bibliography using the Harvard referencing system. (The
recommended word count is 1,500–2,000 words for the report excluding annexures)
21
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
3. Presentation
With the submitted system student should do a presentation to demonstrate the system that was
developed. Time allocated is 10 to 15 min. Student may use 5 to 10 PowerPoint slides while doing the
presentation, but live demonstration of the system is required. Evaluator will also check the ability to
modify and debug the system using the IDE.
LO1. Define basic algorithms to carry out an operation and outline the process of
programming an application.
LO4. Determine the debugging process and explain the importance of a coding
standard
22
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Assignment Brief and Guidance:
23
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Activity 1
A. The Fibonacci numbers are the numbers in the following integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..
Fn = F n-1 + F n-2
n! = n * (n - 1) * …….. 1
Define what an algorithm is and outline the characteristics of a good algorithm. Write the
algorithms to display the Fibonacci series and the factorial value for a given number using
Pseudo code. Determine the steps involved in the process of writing and executing a
program and carry out an analysis of writing the code phase by discussing the potential
challenges faced.
Take a sample number and dry run the above two algorithms. Show the outputs at the end
of each iteration and the final output. Examine what Big-O notation is and explain its role in
evaluating efficiencies of algorithms. Write the Python program code for the above two
algorithms and critically evaluate their efficiencies using Big-O notation.
24
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Activity 2
2.1 Compare and discuss what is meant by a Programming Paradigm and the main
characteristics of Procedural, Object oriented and Event-driven paradigms and the
relationships among them. Write small snippets of code as example for the above three
programming paradigms using a suitable programming language(s) and critically
evaluate the code samples that you have given above in relation to their structure and
the unique characteristics.
Grifindo Toys is a small-scale Toy building company which is located in United Kingdom
(UK) and currently they have 50 employees working at their headquarters. They are looking
for a simple payroll system to calculate the salaries of their employees and you are hired as a
25
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
freelance software developer to build their payroll system.
Specifications for the payroll system as follows,
Grifindo Toys Payroll System mainly contains five components and the specifications for the
components are follows,
1. Employee Component.
Admin should be able to register employee details to the system (including
monthly salary, overtime rates-hourly, allowances).
Admin should be able to update all employee details in the system (Update and
Delete including monthly salary, overtime rates-hourly, allowances).
Admin should be able to view individual employee details, view all employees
details, search employees.
2. Salary Component
Admin should be able to input the date range to calculate the salary. Salary cycle
begin date and the end date should be given to calculate the monthly salary.
Salary cycle begin date and end date will be defined in the settings component
and if the user enters something else the system should display an error message.
The admin should be able to enter the no of leaves an employee has taken with
26
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
number of absent days, no of holidays for the given date range. If an employee
has worked any overtime hours the admin should be able to enter that also when
calculating the Base pay value.
No-pay-value = (Total_Salary/salary_cycle_date_range)
*No_of_absent_days
27
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Base Pay need to calculate according to the below mentioned formula
All the calculated No-pay-value, Base-pay-value and Gross pay value should
record in the database under each employee for each month. This component
should generate reports such as monthly salary report for an employee, overall
salary summary for couple of months for an employee, No-pay-value, base-pay-
value, and gross pay value of all the employees for a given month range.
3. Settings Component
28
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
This component should allow the admin to change parameter values such as
Activity 3
Write the complete pseudocode for the salary component of the above system (report
generation is not needed). Use the visual studio IDE (using C#.net) to implement the
above three components. Ideally, there should be three separate classes for the above
three components and the developer can decide the methods which need to include in
those classes. Design the suitable database structure for keeping the data of the above
29
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
system.
Analyze the features of an Integrated Development Environment (IDE) and explain how
those features help in application development. Evaluate the use of the Visual StudioIDE
for your application development contrasted with not using an IDE.
Activity 4
2.1 Design and build a small GUI system for the above scenario and it should be a complete
functional system with all the functions which has described in the above scenario with the
database structure which has designed in activity 3.
2.2 Examine debugging process and the features available in Visual studio IDE for debugging
your code more easily. Evaluate how you used the debugging process to develop more
secure, robust application with examples.
2.3 Explain and outline the coding standards you have used in your application development.
Critically evaluate why a coding standard is necessary for the team as well as for the
individual.
30
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
31
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
32
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Acknowledgment
Before starting this work, I would want to thank the lecturer, Mrs. Darshani, for all of
her efforts to train my classmates and I. Madom, your advice, encouragement, and
inspiration were greatly appreciated.
Sincerely,
M.Nadun Nisal Wijayapala
33
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Pearson Higher Nationals in
Computing
34
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Unit 01: Programming
Assignment 01
35
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Task 1
LO1 Define basic algorithms to carry out an operation and outline the process of
programming an application.
What is an algorithm?
An Algorithm is any method or formula that has been applied to solve a problem. It
works by running a specified sequence of actions that describe how you do certain
things, and your computer will be doing the same thing every time. The algorithm works
by following some kind of procedure, made up of inputs. As soon as all the inputs are
followed up, they will display a result which can be called output.
36
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
I. Correctness: All valid input should be correctly output by the algorithm. To
achieve the right result, it must solve the problem as intended.
II. Efficiency: To solve the problem, efficient algorithms use a minimum number
of resources available in terms of time, memory, etc. It should be rapidly
implemented, with efficient handling of large inputs.
III. Clear and understandable: A good algorithm is easily understood and must be
described in a clear and comprehensible manner. For developers to understand
its logic, it should be simple.
IV. Finiteness: The algorithm has to be capable of carrying out an infinite number
of steps. Once a period for each input has expired, it should be terminated.
V. Generalities: An algorithm should apply to a range of inputs, which is not
exclusive to special cases. For each scenario, it should be intended to resolve the
problem.
VI. Modularity: You can divide a modular algorithm into smaller, manageable
subroutines or functions. It increases the reusability and maintainability of codes.
VII. Feasibility: it would be practical and appropriate to use available resources and
technologies for implementing the algorithm. It's supposed to be under the
constraints of the system.
Fibonacci series
37
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
38
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Factorial value series
39
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Steps involved in the process of writing and executing a program:
40
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
I. Identifying the problem: We must have a clear picture of the problem and
its requirements.
II. Algorithm design: complex problems can make it difficult to draw up an
effective and appropriate algorithm.
III. Ensuring robustness: It is necessary to deal with corner cases and edge
scenarios.
IV. Debugging: It may take a long time to identify and correct errors in the code.
V. Efficiency optimization: it can be difficult to achieve optimal performance
while minimizing the use of resources.
1) Fibonacci series
41
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Final outputs: 0,1,1,2,3,5,8
2) Factorial
42
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Final output= 5040
Big-O Notation
As a function of its input size n, Big-O notation is used to express the upper bound of an
algorithm's time complexity. It estimates how long an algorithm's run time will be
increasing the input size. For example, the time complexity in the Fibonacci series
43
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
algorithm is O(n) and it's directly dependent on the number of iterations due to its “n”
value. Similarly, because the loop runs from 2 to n, the time complexity of the factorial
algorithm is also O(n).
44
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
II. Python code for Factorial
45
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Efficiency Analysis using Big-O Notation
46
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Factorial Algorithm: The time complexity of this algorithm is also O(n),
as it iterates from 2 to n.
The two algorithms have linear time complexity which means that, due to
the size of the input, their computation runs on a linear basis. They are
quite efficient, even for relatively large inputs, and should be able to do so
well. Both algorithms provide the correct results for the given sample
inputs, as has been observed.
Task 2
Programming Paradigm
A programming paradigm is a basic style and approach for the development of computer
programs. This defines how the code is organized, structured, and implemented. A set of
principles, concepts, and best practices guides the development process for each
paradigm.
47
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
1. Procedural Programming Paradigm:
48
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Object-oriented programming (OOP) revolves around the concept
of objects, which encapsulate data and behavior. The program's
designed to be composed of interacting objects, each responsible
for a specific task. It's intended to support the reusability of code,
modularization, and modeling of actual world entities.
49
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
usually composed of event handlers that respond to these events,
and program execution jumps between these handlers as events
occur.
Evaluation
50
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Object-Oriented Programming Paradigm: With the Rectangle class that
encodes information and behavior, the code implements an object-oriented
approach. An example of encapsulation in which data length and width are
hidden behind methods is given here. This sample contains no evidence of
inheritance or polymorphism.
Event-Driven Programming Paradigm: The code uses Tkinter to show
an event-driven paradigm. An event handler that replies to button-click
events is the function button_click. The program waits for user input (the
button click) and then responds to it. Event-driven paradigms are well-
suited for GUI applications and asynchronous programming.
51
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
better organization and abstraction, making complex programs more
manageable.
Object-Oriented and Event-Driven: In event-driven systems, objects often listen
for events and respond with their methods. OOP's encapsulation allows objects
to be designed as event handlers, making event-driven programming more
structured and modular.
Procedural and Event-Driven: Event-driven programs can use procedural code in
their event handlers to perform specific tasks when events occur. Procedural
programming can help manage the logic of how events are handled and
processed.
In general, each paradigm is based on strengths and weaknesses but the choice of a
paradigm must be relevant to the nature of the problem and its objectives for software
development. Modern programming is often combining several paradigms to take
advantage of their respective benefits, which in turn will create robust, maintainable,
and efficient software systems.
52
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Task 3
53
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Features of an IDE and its benefits:
54
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Project management: Integrated Development Environments offer the ability
to manage projects, making it easier to organize files and dependencies, and to
manage version control systems.
Code Refactoring: Integrated Development Environment provides automated
refactoring tools to improve code quality and retention, through the suggestion
and implementation of changes.
Integrated build systems: Integrated build systems are often used by Integrated
Development Environments to simplify the process of compiling and building
applications.
Version Control Integration: IDEs can seamlessly integrate with version
control systems like Git, enabling easy collaboration among team members.
Code template: code templates and snippets are offered by the IDE, which
reduces the number of repeated coding tasks for developers while improving
their productivity.
Integrated Documentation: To help developers understand APIs and libraries,
the IDE can provide documentation pops and tooltips.
55
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
The Visual Studio is an excellent, easy-to-use Integrated Development Environment
for .NET development. There are several benefits to be gained from Visual Studio in
developing the Grifindo Toys payroll system:
.NET Integration: Visual Studio has great support for C#.NET and other.NET
languages, which makes it easier to create applications in a common
environment.
Rich Toolset: A large variety of tools and features that make it easy to develop,
perform debugging and test are available in Visual Studio.
UI design: Visual Intuitive Studio is equipped with a Dragan drop UI designer
that allows rapid and intuitive creation of user interfaces.
Database integration: Visual Studio introduces database tools for facilitating
the development of databases and access to data, which makes it easy to
implement the required database structure.
Simple Deployment: Visual Studio provides a simple way to install the
application, allowing it to be easily distributed to end users.
Robust Ecosystem: Visual Studio benefits from a large community of
developers, extensive documentation, and a wealth of third-party plugins and
extensions.
56
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Contrasting with Not Using an IDE
Development can still take place without an IDE, but this process may be more time-
consuming and costly. The following problems and drawbacks are some of them:
Manual Tool Setup: Without an IDE, developers might need to manually set up
separate tools for editing, debugging, and building the application.
Limited Code Assistance: advanced code assistance features such as syntax
highlighting, code completion, and debugging are not available in a standard text
editor.
Debugging Complexity: Debugging code without an integrated debugger can be
challenging, as developers would need to rely on print statements or external
debugging tools.
Project Organization: When the project gets complex, it may become difficult
for you to manage project files and dependencies on your own.
Lack of integration: Without the Integrated Development Environment,
developers may have to switch between different tools for programming,
building, and testing which would result in a less efficient process.
57
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
The Integrated Development Environment like Visual Studio makes the development
process much more productive and provides a full range of tools and features to enhance
productivity, code quality, and collaboration. It provides developers with a single
environment, which enables them to simplify their development process and save time
and effort in the absence of an Integrated Development Environment.
Task 4
58
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
59
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Login UI
60
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Employee component
61
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Salary Component
Setting Component
62
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
4.2 Debugging Process and Features in Visual Studio IDE
63
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
current line and moves to the next line, Step Into enters a function
or method call, and Step Out runs the remaining code in the
current function and returns to the calling function.
III. Watch and Locals Windows: While the Locals window shows
local variables in the current scope, the Watch window allows
you to monitor the value of variables while debugging.
IV. Immediate Window: Allows you to execute code snippets and
access variables during debugging, providing real-time
evaluation.
V. Call Stack Window: This shows a path to the current execution
point for each method call to help understand how programs are
executed.
VI. Exception Settings: You may modify how Visual Studio handles
exceptions so that you can ignore or break particular errors.
VII. Edit and continue: If you make code changes during
debugging, the program won't need to be restarted to reflect the
changes.
64
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Debugging plays a vital role in increasing security and robustness while
developing applications. Examples of how debugging contributes to achieving
these objectives are given below:
65
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
4.3 Cording Standards and their importance
The code standards are a set of guidelines and best practices that teams or individuals
follow in the development of codes. They assist in the continuous maintenance of
uniform and high-quality code throughout a project. Here is a description of the
programming standards that developers use to develop applications:
66
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Code review: To ensure that coding standards are complied with and to
spot potential problems at an early stage of development, code reviews
shall be carried out.
67
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Flexibility: By providing guidelines to accelerate development efforts and
decrease the learning curve for newly recruited members of teams, a well-
defined coding standard is helping to scale up the development process.
Security: Simplification techniques that help to write more secure codes
and mitigate security weaknesses of all kinds may be part of the coding
standards.
Code reviews: To ensure that all codes are assessed according to the
uniform set of instructions, coding standards provide a basis for efficient
code reviews.
To ensure the consistency of code, improve its quality and facilitate collaboration
among development teams, coding standards are essential. Teams will be able to
build better, more reliable, and more resilient applications through the use of code
standards.
68
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Reference
69
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
4. Mikejo5000 (n.d.). First, look at the debugger - Visual Studio
(Windows). [online] learn.microsoft.com. Available at:
https://learn.microsoft.com/en-us/visualstudio/debugger/debugger-
feature-tour?view=vs-2022.
5. Geeksforgeeks (2019). Coding Standards and Guidelines -
GeeksforGeeks. [online] GeeksforGeeks. Available at:
https://www.geeksforgeeks.org/coding-standards-and-guidelines/.
70
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
Grading Rubric
71
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
P1 Define an algorithm and outline the process in building an
application
72
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
LO2 Explain the characteristics of procedural, object-
orientated and event-driven programming
73
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
D2 Critically evaluate the source code of an application that
implements the procedural, object-orientated and event-
driven paradigms, in terms of the code structure and
characteristics.
74
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
P4 Write a program that implements an algorithm using an
IDE.
75
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
P5 Explain the debugging process and explain the
debugging facilities available in the IDE.
76
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
77
M.Nadun Nisal Wijayapala
Programming
Assignment No 1
78
M.Nadun Nisal Wijayapala
Programming
Assignment No 1