Unit 1 Assignment 1 Frontsheet
Unit 1 Assignment 1 Frontsheet
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.
Student’s signature
Grading grid
P1 M1 D1
1
❒ Summative Feedback: ❒ Resubmission Feedback:
1
Table of Contents
List of Figures:..............................................................................................................................................................2
List of Tables:...............................................................................................................................................................3
Introduction.................................................................................................................................................................3
I. Provide a definition of what an algorithm is and outline the process in building an application (P1).................3
1.1 Definition of algorithm:...................................................................................................................................................................................... 3
1.2 Ways to demonstrate algorithms...................................................................................................................................................................4
1.3. Characteristic of Algorithms............................................................................................................................................................................5
1.4 Steps in program development.......................................................................................................................................................................6
II. Conclusion.............................................................................................................................................................15
III. References............................................................................................................................................................15
List of Figures:
Figure 1: Algorithm Example 4
Figure 2: Flowchart 5
Figure 3: Flowchart 7
2
Figure 12: Test Program 15
List of Tables:
Introduction
In this report, I defined algorithms as efficient step-by-step instructions to solve problems and
showcased their real-life applications. The report introduced two methods of expressing algorithms:
Pseudocode and Flowchart.Additionally, I discussed the key characteristics of effective algorithms,
ensuring clarity, accuracy, and computational feasibility. The report outlined the step-by-step process of
ASM application development, from problem analysis to deployment.
I. Provide a definition of what an algorithm is and outline the process in building an application
(P1)
3
Figure1. Algorithm Example
Algorithm in Daily Life: The process of making a cup of tea can be represented as an algorithm. The steps,
such as boiling water, adding tea leaves, and sweetening, form a sequence to achieve the desired
outcome, a cup of tea.
Pseudocode Example:
Start
4
Get 5
Console.WriteLine("Enter the second number (B):")
Get 5
double sum = numA + numB
Console.WriteLine($"The sum of {numA} and {numB} is: {sum}");
End.
b) Flowchart: In this example, the flowchart and pseudocode demonstrate a simple algorithm to
calculate the sum of two numbers (A and B) and display the result (C). The algorithm takes two
inputs, adds them together, and outputs the sum. The flowchart and pseudocode illustrate the
steps involved in a clear and concise manner.
Figure2. Flowchart
5
Input: An algorithm can take one or more inputs or even no inputs at all, depending on the problem it
addresses.
Output: An algorithm should produce at least one output based on the given inputs and the steps
followed.
Definiteness: Each step in the algorithm must be clear, well-defined, and precise, leaving no room for
ambiguity.
Effectiveness: Each step of the algorithm should be simple and should be executable in a finite amount of
time.
Step 2:
Algorithm:
1. Start
4. Display C
5. End
- Pseudo code:
Start
6
Console.WriteLine($"The sum of {numA} and {numB} is: {sum}");
End.
- Flowchart:
Figure3. Flowchart
7
Figure4. Code Program C#
8
Figure5. Set Breakpoint
9
v
10
v
11
Figure9. Console returns results and finishes
Step 6: Testing:
Testing the program using various test cases is crucial after writing and debugging the code. It ensures
the program produces correct results in different scenarios, verifying its accuracy and reliability.
12
Figure 10: Testing
Here is an updated version of the code that includes subtraction, multiplication, and division operations
in addition to the existing addition operation:
13
Figure 13: Updated code
This code allows the user to enter two numbers and then performs addition, subtraction, multiplication,
and division operations on those numbers. The results of each operation are then displayed to the user.
14
Figure 14: Test Program
Once the program is tested and deployed, ongoing maintenance and updates are essential. User
feedback helps address issues and improve the program. Regular updates add new features and keep the
program relevant. Documentation and version control aid in managing changes. Scalability, performance
monitoring, and security ensure a seamless and secure user experience.
II. Conclusion
In conclusion, algorithms form the foundation of problem-solving in various fields, and their effective
implementation leads to efficient solutions. The steps involved in program development, including
problem analysis, algorithm design, coding, debugging, testing, deployment, and maintenance, are
essential for building functional and reliable applications. By adhering to the characteristics of effective
algorithms and following a systematic approach, businesses can create innovative solutions to address
their unique challenges and achieve their objectives.
III. References
15