0% found this document useful (0 votes)
11 views

Unit 1 Assignment 1 Frontsheet

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Unit 1 Assignment 1 Frontsheet

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: Programming

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Student ID

Class Assessor name

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:

Grade: Assessor Signature: Date:


Lecturer Signature:

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

Figure 4: Code Program C# 8

Figure 5: Set Breakpoint 9

Figure 6: Run Program 9

Figure 7: Stop in Breakpoint 1 10

Figure 8: Stop in Breakpoint 2 11

Figure 9: Console returns results and finishes 12

Figure 10: Testing 13

Figure 11: Updated code 14

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)

1.1 Definition of algorithm:


An algorithm is a step-by-step set of instructions designed to perform a specific task or solve a problem.
It is a finite sequence of well-defined and unambiguous steps that produce a desired output from a given
input.

3
Figure1. Algorithm Example

- Give an example of algorithms in real life:

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.

1.2 Ways to demonstrate algorithms


There are various ways to express algorithms, two common methods being:

a) Pseudocode: Pseudocode is a human-readable representation of an algorithm that uses simple


language constructs to outline the steps without getting into specific syntax. For example:

Pseudocode Example:

Start

Console.WriteLine("Enter the first number (A):")

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

1.3. Characteristic of Algorithms


Finiteness: An algorithm must have a finite number of steps and terminate after a finite time to produce
the result.

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.

1.4 Steps in program development


Step 1:

The problem is to add two numbers entered by the user.

Step 2:

Algorithm:

1. Start

2. Input two numbers, A and B

3. Calculate the sum of A and B and store it in C

4. Display C

5. End

Step 3: Program design:

- Pseudo code:

Start

Console.WriteLine("Enter the first number (A):")


Get 5
Console.WriteLine("Enter the second number (B):")
Get 5
double sum = numA + numB

6
Console.WriteLine($"The sum of {numA} and {numB} is: {sum}");

End.

- Flowchart:

Figure3. Flowchart

Step 4: Code program:

The algorithm into C# code:

7
Figure4. Code Program C#

Step 5: Debugging the program

8
Figure5. Set Breakpoint

Figure6. Run Program

9
v

Figure7. Stop in Breakpoint 1

10
v

Figure8. Stop in Breakpoint 2

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

Step 7: Deployment and maintenance:

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

You might also like