SampleAssignment
SampleAssignment
Student Name/ID
Unit Title
Assessor Feedback:
LO1. Define basic algorithms to carry out an operation and outline the process of programming an applicat
LO2. Explain the characteristics of procedural, object-orientated and event-driven programming, conduct
an Integrated Development Environment (IDE).
LO4. Determine the debugging process and explain the importance of a coding standard.
Assessor Feedback:
• 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.
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 body
except for the before mentioned compulsory information will result in rejection of your
work.
2. Avoid using page borders in your assignment body.
3. Carefully check the hand in date and the instructions given in the assignment. Late
submissions will not be accepted.
4. Ensure that you give yourself enough time to complete the assignment by the due date.
5. Excuses of any nature will not be accepted for failure to hand in the work on time.
6. You must take responsibility for managing your own time effectively.
7. 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.
8. Failure to achieve at least PASS criteria will result in a REFERRAL grade.
9. Non-submission of work without valid reasons will lead to an automatic RE FERRAL. You will
then be asked to complete an alternative assignment.
10. 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 intext citation
and a reference list.
11. 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
12. Use word processing application spell check and grammar check function to help editing
your assignment.
13. 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.
Student Declaration
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the
consequences of plagiarism. I understand that making a false declaration is a form of malpractice.
Submission Date
Submission Format
The assignment submission is in the form of the following.
• The submission should be in the form of an individual written report written in a
concise, formal technical style using single spacing and font size 12. • Student has to
submit the complete GUI System with the database.
LO4. Determine the debugging process and explain the importance of a coding standard
• Contextual awareness, e.g. the ability to understand and meet the needs of individuals,
business and the community, and to understand how workplaces and organisations are governed.
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.
Grifindo
LankaToys is a small
-scale Toy building companyiswhich
inSri Lanka
and
currently they have
20 employees working
thisatcompany
. Grifindo Lanka Toys is the Sri
Lankan branch of Grifindo Toys Company which is in UK and previously they have hired your
freelance company to develop their payroll system and now they are hiring you again to
develop their leave management system for the Sri Lankan
Grifindo
Lanka
branch,
Toys
Company
.
Specifications forleave
the management
system as follows,
This leave management system has two user roles, and they are
Admin,
Employee
and theyand
are having two separate desktop applications to interact with the centralized
. Developerdatabase
can consider the centralized database
as a local database for the development purposes.
1. Employee Application.
• Employee should be able to login to the system with the employee number and
the given password.
Note:- Normally an employee has 14 annual leaves, 7 casual leaves for a year and
2 shorts leaves per a month. Employee can apply casual leaves as they want
before their defined roaster starts. Annual leaves can be applied before 7 days
prior to the leave date. Short leave duration is 1 hour and 30 minutes and can be
applied for up coming time slots.
• Employee can view the status of applied leaves (Whether applied leaves are
approved or not).
• Employee can view their remaining leaves and history of applied leaves.
2. Admin Application
• Admin should be able to define the number of annual leaves, casual leaves for a
year and 2 short leaves per every month for every employee. (Newly joined
employees will less number of leaves compared to permanent employees)
• Admin should be able to define the roaster starting time and end time for each
employee.
Activity 3
3.1. Write the complete pseudocode for the employee apply leave function of the
above system. Use the visual studio IDE (using C#.net) to implement the above two
applications. Ideally there should be two separate classes for the above two applications 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 system.
Activity 4
4.1 Design and build two small GUI systems for the above scenario and those two applications
should be complete functional systems with all the functions which has described in the
above scenario with the database structure which has designed in activity 3.
4.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.
4.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.
HN Global:
HN Global HN Global (2021) Reading Lists. Available at:
https://hnglobal.highernationals.com/learning-zone/reading-lists
Definition of an Algorithm
It should be taken into mind that all written instructions are not algorithms. For some
instructions to be algorithms, it must have certain characteristics
It should be clear and unambiguous, it should lead to only one meaning
Well defined inputs
Well defined outputs
Efficiency: It should use the least amount of resources, such as time and space.
Finiteness: The algorithm should terminate after a finite number of steps.
Clarity: The steps should be easy to understand and implement.
Feasible: The algorithm must be simple, generic, and practical, such that it can be
executed with the available resources.
Language Independent: The Algorithm designed must be language-independent, i.e. it
must be just plain instructions that can be implemented in any language, and yet the
output will be the same, as expected.
General Applicability: It should be applicable to a range of inputs.
What is Calculations?
A set of instructions intended to complete a task is called an algorithm. Most of the time,
algorithms take one or more inputs, run them through a series of steps in a systematic way,
and then give you one or more results.
Algorithms are a crucial part of computer programming and are typically associated with
computing. Calculations can be utilized to achieve different computational undertakings,
like performing estimations or tracking down data in data sets. Outside of
programming, algorithms can also be created and used.
They can be done manually by people or automatically by machines.
For example,
you could do long division on paper instead of using a calculator to do the same thing.
Clients don't have to comprehend the internal activities of calculations to utilize them.
Truth be told, numerous calculations utilized by organizations are strictly confidential
mysteries, hindering clients from seeing precisely the way that they work.
1. Acknowledge that you're going through a troublesome time and permit yourself to feel
the feelings.
2. Attempt to keep away from interruptions and live reality likewise give yourself space to
recuperate.
3. Examine the relationship to discover what went wrong and what you can learn from it.
4. Converse with companions, family, or a specialist about your sentiments to assist with
handling the separation.
5. Concentrate on physical and mental well-being-enhancing activities like exercise, hobbies,
or meditation.
6. Avoid unfortunate ways of behaving like unreasonable drinking or separating yourself.
7. Helping you move on with your life, create a new daily routine without her.
8. Recognize new private or expert objectives to concentrate your energy and provide
yourself a feeling of motivation.
9. Advise yourself that mending requires some investment, and that it's a chance for self-
awareness.
10. Progressively free yourself up to new encounters and conceivable outcomes, including
the potential for future.
The self-care algorithm then goes on to describe every step that would guarantee healing,
including engaging in constructive activities, avoiding destructive coping strategies,
and seeking assistance.
This large number of calculations demonstrate that lucidity and rationale of the guidelines
can turn out subordinate and extremely viable in such a major circle of life.
They are the actual embodiment of critical thinking in the fields of software engineering and
designing, and, surprisingly, in some basic daily existence circumstances;
they work on aiding one handle profound stressing circumstances in a coherent and certain
Pseudocode and a flowchart are two ways to show the control flow of a program, algorithm,
or process through its statements. Pseudocode and the flowchart differ significantly in how
they depict the control flow. The flowchart is a graphical portrayal of a calculation. However,
the algorithm's textual representation is known as the pseudocode. Well, we can use these
ideas together to create software or use them on their own.
Calculations for Fibonacci and Factorial Fibonacci grouping Each number in the Fibonacci
sequence is created by adding the two numbers that came before it. Beginning with 0 and 1,
each ensuing number in the grouping is the amount of the past two. This makes a particular
example: 0, 1, 1, 2, 3, 5, 8, 13, 21, etc.
Display numA
Display numB
For i = 3 to n:
nextNum = numA + numB
Display nextNum
numA = numB
numB = nextNum
End while
End
Factorial capability
The factorial capability is an essential idea in math, with applications crossing different fields
like math, science, measurements, designing, and software engineering.
It is a useful tool for figuring out how many different options there are for a given situation.
By duplicating all certain whole numbers up to a particular number,
the factorial capability epitomizes the critical standards of stages and blends, making it
fundamental for tackling issues connected with these ideas.
Start
Input n
Introduce result = 1
From n to i = 2:
result = result * I
End For
Display result
End
Show the result End This calculation computes the factorial of a given number n by instating
a variable outcome to 1. It then, at that point, utilizes a for circle to repeat from 2 through n,
duplicating result by each circle list I to gather the result of all whole numbers from 1 to n.
In the wake of finishing the circle, the last worth of result addresses the factorial of n, which
is then shown. The factorial is accurately computed using this straightforward iterative
method.
Problem Analysis
Issue investigation is a progression of steps for recognizing issues, examining them, and
creating answers for address them. It's a request or examination concerning the reasons for
a mistake, disappointment, or unforeseen episode. While the significant point of issue
examination is to foster arrangements, the cycle likewise furnishes you with a top to bottom
comprehension of an issue that empowers you to forestall different sorts of issues that could
emerge from a similar reason. (Team, 2024s
Coding
What’s exactly is coding and how does it work? We should begin with a coding definition in
straightforward terms. Coding in PCs is the most common way of composing directions for
PCs that we call code. Coding lets humans create instructions that computers can
comprehend and carry out. The coding stage is a basic stage where reasonable plans are
rejuvenated through the improvement of genuine programming code. Software engineers
make an interpretation of these plans into a programming language, holding back nothing is
organized, coordinated, and viable.
In the wake of coding, the following critical step is changing the code into machine-
comprehensible directions that the PC can comprehend and execute.
This is where accumulation becomes fundamental. A compiler makes an interpretation of
intelligible code into an organization that is conceivable
to the PC's processor. This indispensable interaction guarantees that the code you've
composed is precisely changed over into directions that the PC can execute productively.
Testing
Testing is a urgent stage that guarantees the program acts true to form and produces exact
results across different information sources.
To find bugs, errors, and unexpected behaviors, comprehensive testing uses a variety of test
cases.
This stage likewise incorporates troubleshooting, which is the method involved with
distinguishing and fixing code-related issues to accomplish the ideal usefulness.
Investigating is fundamental for settling code issues and guaranteeing a dependable
programming item. It requires an organized methodology and different instruments to help
engineers pinpoint and address issues.
Data breakpoints, conditional breakpoints, step-over breakpoints, step-into breakpoints, and
step-out breakpoints all aid in comprehending code flow and spotting deviations from
expected behavior.
Challenge
It can be hard to figure out where a null pointer exception occurs, especially in
complicated applications with many interconnected parts.
This blunder frequently brings about accidents or application disappointments, making it
basic to address.
Solution
Implement Null Checks:
Before making use of an object reference, add null checks to ensure that it is not null. For
instance, utilize restrictive proclamations to check that the item is appropriately instated
prior to getting to its techniques or properties. By handling the situation in which the
reference might be null, this stops the exception from happening.
2. Buffer Overflow
When a program writes more data to a buffer—a temporary storage location—than it
can hold, this results in a buffer overflow error. This can overwrite nearby memory,
prompting information defilement, accidents, or security weaknesses.
Solution
Utilize Safe Support The board Strategies:
Carry out limits checking to guarantee that information kept in touch with a cradle
doesn't surpass its distributed size. Furthermore, utilize more secure capabilities and
libraries that handle cradle measures and forestall spills over,
for example, those that perform programmed limits checking or utilize dynamic memory
the board procedures.
The Fibonacci sequence for the number 5 is calculated step by step in this table.
The algorithm calculates nextNum by adding these two values, starting with numA = 0 and
numZ = 1, and then updates numA and numZ accordingly. After the initial display of numA,
the output for each subsequent step is the current numA while the nextNum is computed
and used to update the sequence. This cycle go on until count rises to 5, so, all in all the circle
closes, and the last result showed is the fifth Fibonacci number, which is 5.
A dry run is a method for understanding how an algorithm calculates a given number's
factorial by going through each iteration of the algorithm sequentially.
Seeing the algorithm's step-by-step progression in this way makes it easier to understand
how the final result is achieved. This approach gives significant bits of knowledge into the
interior operations of the calculation, making it a helpful instrument for both learning and
Debugging.
This table frameworks the bit by bit course of ascertaining the factorial of the number 4.
At first, the augmentation begins with multipliedNum = 1.
As the means progress, the calculation duplicates multipliedNum by the ongoing worth of x
(beginning from 1), refreshing multipliedNum each time. For example, in the initial step, 1 * 1
= 1, in the subsequent step, 1 * 2 = 2, etc. This goes on until x is greater than the value of
num (4). The condition x = num is false when x reaches 5, and the output of the loop is the
final factorial value of 24.
Big O documentation is a useful asset utilized in software engineering to depict the time
intricacy or space intricacy of calculations.
It gives you a standard way to compare how well different algorithms work in the worst-case
scenario. Seeing Huge O documentation is fundamental for dissecting and planning
proficient algorithms.
In this instructional exercise, we will cover the essentials of Enormous O documentation, its
importance, and how to break down the intricacy of calculations utilizing Huge O.
2. O(log n): Logarithmic-time calculation runs in time corresponding to the logarithm of the
information. The most widely recognized model is maybe twofold pursuit given an
arranged exhibit (with irregular access) of n components, we can find regardless of
whether a particular thing is in the cluster by utilizing double hunt, separating the hunt
space by half by really looking at the center component.
3. O(n): Direct time calculation runs in time relative to the information. This can be
fortunate or unfortunate: when n is the quantity of components in a variety of whole
numbers, radix arranging permits us to sort it in direct time, a generally excellent
exhibition, however when n is a positive number and we need to check whether it's
prime, doing preliminary division by and large numbers 2,3,… , n −12,3,… ,n−1 is a
lackluster showing.
4. O(n log n): For "reasonable" input, a linearithmic-time algorithm operates in a time that is
not particularly distinguishable from linear-time, and it is frequently encountered in
sorting algorithms. Since linearithmic-time has been shown to be the most efficient
5. O(n2): Algorithms with quadratic time take time equal to the square of the input.
Schoolbook multiplication of two n-digit numbers or two polynomials of degree n (faster
algorithms exist, such as Karatsuba's algorithm), some slow sorting algorithms (such as
selection sort and insertion sort), and dynamic programming's solution to the longest
common subsequence problem are examples of algorithms that take this long.
Linear Search
Despite the fact that the exhibit/list is arranged or unsorted we think about the
components one - by - one from the first component to until the normal outcome found or
for
the rest of the cluster. We need to look through all components on the off chance that that
normal outcome isn't in the rundown. The intricacy is straightforwardly connected with the
quantity of the data sources - a calculation makes an additional input for each extra
information Model: What number of cycles that you really want to figure out component
25, 11 and 8?
26 11 36 21 5 25 43 79 7 9
When we have to locate an element like number 17, it becomes more difficult and worse.
Since then we would look through every one of the components in the rundown to give the
outcome as component isn't found.
Binary Search
The rundown should be arranged. In binary search, we use the
divide and conquer strategy to locate the required output and the middle index.
After locating the middle element, we split the array and re-locate the middle element until
we achieve the desired output. Center list is tracking down through a little estimation as
Mid file = current least record (current most elevated list - current most minimal file)/2
Binary search is more proficient than straight inquiry. On the off chance that, when we are
finding a component through parallel hunt, it produces the result by less measure of
emphases than straight inquiry.
5 7 9 11 21 25 26 36 43 79
(Need to be sorted)
Bubble Sort
Basically, in bubble sort, we are arranging the array / list in order. It takes several iterations
Example:
34 12 45 22 8 29 57 93 18 4
Iteration 1 –
12 34 22 8 29 45 57 18 4 93
Iteration 2 –
12 22 8 29 34 45 18 4 57 93
Iteration 3 –
12 8 22 29 34 18 4 45 57 93
Iteration 4 –
8 12 22 29 18 4 34 45 57 93
Iteration 5 –
8 12 22 18 4 29 34 45 57 93
Iteration 6 –
8 12 18 4 22 29 34 45 57 93
Iteration 7 –
8 4 12 18 22 29 34 45 57 93
Iteration 8 –
4 8 12 18 22 29 34 45 57 93
This array took seven iterations to sort. Now, its clear that bubble sort or class E has the
lowest efficiency in Big – O notation
This iterative Fibonacci calculation effectively works out the nth Fibonacci number. As these
are base cases, it checks whether n is 0 or 1, and returns n immediately. It uses two
variables, numA and numZ, to keep track of the previous and current Fibonacci numbers
for larger values of n. The circle emphasizes from 2 to n, refreshing these factors to
iteratively create the succession. After the circle, numZ contains the ideal Fibonacci
number, which is then returned. This approach has a period intricacy of O (n) and a space
intricacy of O (1), making it both basic and effective.
This iterative factorial capability computes the factorial of a given number n. It begins by
introducing result to 1, then, at that point, emphasizes through all numbers from 2 up to n,
duplicating result by every one of these numbers. The circle actually fabricates the result of
all
numbers from 1 to n, putting away the last factorial worth in outcome. The function returns
result, which contains the computed factorial of n, after the loop has been completed. For
instance, if n = 5, the capability returns 120 since 5! = 5×4×3×2×1=120!
The Python code for the Fibonacci series intently follows the pseudocode, beginning by
instating the factors numA, numZ, and nextNum. After that, it makes use of a loop that
repeats
itself n times, updating nextNum with the sum of numA and numZ on each subsequent
iteration
while effectively shifting the values between these variables. In addition, the code optimizes
by
initializing resultArray to store the values of the Fibonacci series. This is a good practice for
effectively managing the sequence throughout the iterations and keeping track of it.
Procedural programming
A programming language known as procedural uses a series of functions and
commands to carry out tasks. Many programming dialects utilize the procedural
programming worldview, including Fundamental, C and Pascal.
As many professional programmers begin their careers by learning to program in a
procedural programming language, learning to program in a procedural programming
language is frequently a foundational experience for aspiring developers.
1. Predefined capabilities
In a procedural programming language, a function from a library of available
functions is referred to as a predefined function. These capabilities permit a
software engineer to finish normal jobs without making the expected code
themselves. This can assist a designer with saving time during creation.
2. Local variables
A programming variable with a local scope of application is known as a local
variable. This implies the variable just capabilities in the capability wherein the
engineer characterizes it. If a professional or user attempts to use a local variable
•Flexibility:
Procedural writing computer programs is an adaptable worldview that permits
designers to make coding projects that achieve fundamentally changed objectives.
With procedural programming dialects intended for the vast majority various sorts of
advancement projects, including programming and web improvement, there's logical a
viable procedural programming language you can use to achieve your objectives
.
•Effortlessness:
Procedural writing computer programs is a generally basic way to deal with PC
programming. Because they provide a foundation for coding that the developer can
apply as they learn other languages, such as an object-oriented language, procedural
programming languages are the first choice of many developers.
•Openness:
Numerous well known programming dialects utilize procedural programming, so there
are numerous assets accessible to a hopeful engineer expecting to learn them. This
includes both paid courses and free online communities and resources that you can
use when you run into problems to help you grow faster. 2024 (Preston)
1. Class A
class is the essential unit of C++ that makes ready for object-situated programming.
It is a client characterized information type that can be gotten to and utilized by
making a case of that class.
It has its own member functions and data members. A class is tantamount to an
item's diagram. Both part works and information individuals are tracked down in
classes. The information individuals inside the class are controlled utilizing these part
works.
2. Object
The description is the first object to be defined when a class is created. An example
of a class exists in an item.
It is important to note that the system does not allocate any memory space when a
class is specified; rather, it does so when the class is instantiated, or when an object is
formed.
True things share state and conduct practically speaking, a couple of elements.
An object keeps its information in its attributes and uses methods to hide its
behavior.
Benefits of OOP
•Empowers code reusability:
The possibility of legacy is one of the basic ideas presented by object-arranged
programming. Through inheritance, the attributes of a class can be handed down to
future generations without requiring additional work. Doing this forestalls the issues
related with over and again composing a similar code.
• Ease of troubleshooting:
When object-oriented programming is used, troubleshooting is made easier because the
user
knows where to look in the code to find the problem's root cause. There is no need to
examine
any additional code areas because the error will indicate the location of the problem. One
advantage of encapsulation is that all objects in object-oriented programming (OOP) are self-
constrained. This multimodal behavior gives DevOps engineers and developers a lot of
advantages because they can now work on multiple projects simultaneously and avoid code
duplication. (BasuMallick, 2022)
1. Deliberation:
Improves on complex cycles into reasonable parts, making code simpler to
work with and comprehend.
1. Control Flow
is the process of determining the order in which instructions are carried out.
2. Simultaneousness:
Deals with various assignments or cycles running all the while.
4. Sensible Programming
- Benefits:
- Inference Engine: A rule-based reasoning tool that makes use of an inference engine.
- Decisive Style: Utilizes a definitive methodology for critical thinking.
- Burdens:
- Rules' Complexity: It can be difficult to manage complex rule systems.
- Expectation to learn and adapt: Might be hard to learn because of its exceptional
methodology.
1. Procedural Worldview
The procedural worldview lays the foundation for both item situated and occasion
driven programming. Programs are organized around procedures or functions in this
paradigm. Procedural aspects can be incorporated into both object-oriented and
event-driven paradigms, particularly when dealing with algorithm implementation
and regulating logical flow.
What is an IDE?
An integrated development environment (IDE) is a software package that includes the basic
tools required to design and test software.
Software developers use a range of tools for authoring, developing, and testing code.
Development tools include things like text editors, code libraries, compilers, and test platforms.
Without an IDE, a developer has to select, utilize, integrate, and oversee each of these tools on
their own. An Integrated Development Environment (IDE) might be a framework, application, or
service that combines many of these development-related elements. The integrated toolset is
designed to make software development easier and is capable of identifying and reducing typos
and code errors.
While some IDEs can be obtained for free, others require payment. An IDE can be a standalone
program or a part of a larger package (Gillis & Silverthorne, 2022).
Code editor: Designed specifically for editing computer system source code, the code editor is
one of the most essential tools for programmers. Simply put, a code editor is a text editor with
additional features for creating code. It simplifies coding for all users by providing more
advanced tools and enabling coding coloring. An IDE, independent software package, or web
browser can all come with a basic code editor. If a person is just starting out and learning to
code in any language, they should utilize a code editor. It performs similar tasks as a text editor
but has additional features and functionalities built in. These tools help make editing easier and
faster by identifying problems and troubleshooting code.
users in creating more advanced applications. There are numerous code editors available, such
as Atom, Visual Studio Code, Sublime Text, and many more.
The code editor is a useful tool for developers. As a result, provides a plethora of options for
theme customization.
has intelligent code completion that is compatible with the majority of languages.
Debugging:
Debugging is the process of identifying and resolving issues with software code that may cause
crashes or unexpected behavior. Sometimes, people refer to these mistakes as "bugs." Debugging
is the process of finding and repairing errors or defects in systems or software to prevent
improper operation. When many subsystems or modules are intimately related to one another,
debugging becomes more challenging since any changes made to one module may cause new
defects to arise in other modules. Sometimes developing software from scratch is quicker than
debugging it.