Essay Available:
You are here: Home → Essay → IT & Computer Science
Pages:
10 pages/≈2750 words
Sources:
7 Sources
Level:
Harvard
Subject:
IT & Computer Science
Type:
Essay
Language:
English (U.S.)
Document:
MS Word
Date:
Total cost:
$ 39.95
Topic:
Website Design and Development (Essay Sample)
Instructions:
This was an assignment on computer programming. it covers the basic algorithm aspects of programMING. the paper addresses different learning objectives including definition of algorithm, steps in code writing, algorithm implemenTATION in the desired language, characterisics of different programming approaches, features of an integrated program, and an evaluation of the source codes of applications used in programming. source..
Content:
OSHWAL
COLLEGE
Qualification
Unit number and title
Pearson BTEC Level 4 Higher National Certificate in Computing
Unit 10: Website Design and Development
Unit Code: R/615/1633
Unit Level:4
Unit Type:
Credit Value:15
Student name
Assessor name
Mr. David Ngesa
Assignment
Date issued
Completion date (If extension is granted, deadline extension document must be attached)
LO1 Define basic algorithms to carry out an operation and outline the process of programming an application
P1 Provide a definition of what an algorithm is and outline the process of building an application
M1 Determine the steps taken from writing code to execution
D1 Examine the implementation of an algorithm in a suitable language. Evaluate the relationship between the written algorithm and the code variant
An Algorithm refers to a set of rules or processes to be observed in calculations or other operations involving finding solutions to problems (Lambora et al., 2019). Hence, it can be used to explain the instructions that provide a step-by-step definition of how an operation is to be executed to achieve the desired outcome. Understanding the concept of algorithms can work better with practical examples, like in the case of following a new recipe in a cooking procedure. To make a meal from a new recipe, an individual must read through the instructions and steps provided followed by a step-by-step execution in the sequence. The outcome is a perfectly cooked dish that becomes the desired output of the process. This is similar to an algorithm where a task is undertaken within a programming function to obtain the required output.
The algorithm design is language-independent; they are basic instructions whose implementation can happen in any language. The output will be similar to the expected outcomes regardless of the language used in the instructions.
Characteristics of an Algorithm
The example of a cooking recipe requires that only a standard set of instructions is followed, as any other form of instructions would result in an undesired outcome. The same principle applies to algorithms where not all written instructions can qualify to be algorithms. Hence, the following characteristics must be present for instructions to qualify as an algorithm.
* Clarity
An algorithm must be clear and free from ambiguity to achieve the desired output. Each step in the instructions should maintain clarity in all aspects and only lead to one outcome (Lambora et al., 2019). Any instructions that contradict this principle do not qualify to be an algorithm
* Well-Defined Inputs
Any form of input subjected to an algorithm should be defined appropriately to limit the risks of errors while undertaking the intended operations.
* Well-Defined Outputs
The output to be yielded by an algorithm must be clearly defined (Lambora et al., 2019). This will help ensure any inconsistencies in the outcome are traced by simply observing the outcome obtained.
* Finiteness
An algorithm should maintain its finite abilities meaning never end up in infinite loops as this may affect the required outcomes of projects.
* Feasibility
The feasibility of an algorithm relates to its ability to be less complicated, generic, and achievable. Hence, it should be executed provided the necessary resources are available. The algorithm must not rely on future technology as this would challenge the related practicality.
* Independence from language
While designing an algorithm, programmers must ensure that language independence is realized (Lambora et al., 2019). This means the algorithm should only have uniform instructions that can be implemented in various languages, with the outcome remaining similar to the expectations.
Advantages of Algorithm
* Algorithms are easy and simple to understand.
* It entails a step-wise representation of solutions to particular problems making the resolution easy and faster
* The programmers can easily convert algorithms to actual programs because they are broken down into smaller steps and pieces.
Disadvantages
* Writing an algorithm may take a long time, making the whole design process time-consuming.
* Algorithm writing requires branching and looping statements that could be challenging to show.
Algorithm Design Process
The following items are necessary as a pre-requisite in writing an algorithm;
* The problem to be solved by the algorithm
* The problem constraints for consideration in creating a solution to the challenge
* The required input for the program to find a solution.
* The expected output when a successful solution is reached
* The required solution to the problems in the provided constraints.
The above is necessary for the writing process to help solve the problem (Das & Kumar, 2018). For instance, in the case of writing an algorithm to add three numbers and print their total, the design process will involve the phases presented below.
Phase 1: Pre-requisite fulfilment
As already mentioned, writing an algorithm requires the fulfilment of pre-requisites. Hence, the following procedures are necessary;
* The problem to be solved by the algorithm: Add three numbers and print the total.
* The problem constraints for consideration in creating a solution to the challenge: The three numbers must only consist of digits and not any other characters.
* The required input for the program to find a solution: Addition of the three numbers to obtain the sum.
* The expected output when a successful solution is reached: The total of the three numbers used as input.
* The required solution to the problems in the provided constraints: The solution lies in finding the sum of the three numbers. This can happen through the help of a bit-wise, or ‘+’ operator, or other methods (Jooshin & Nangir, 2020).
Phase 2: Algorithm Design
The above pre-requisites will help design the algorithm as per the following illustrations.
Algorithm to find and print the sum of three numbers
1 START
2 Declare the three integer variables num1, num2, and num3.
3 Take the three numbers to be added as inputs in the respective variables.
4 Declaration of the integer variable sum to keep the resultant total of the three numbers.
5 Addition of the three numbers and keep the result in the variable sum.
6 Print the value of the variable sum.
7 END
Phase 3: Testing the algorithm through implementation
To test the algorithm, it is implemented in the C language as follow
// C++ program to add three numbers
// with the help of above designed
// algorithm
#include <bits/stdc++.h>
using namespace std;
int main()
{
// Variables to take the input of
// the 3 numbers
int num1, num2, num3;
// Variable to store the resultant sum
int sum;
// Take the 3 numbers as input
cout << "Enter the 1st number: ";
cin >> num1;
cout << " " << num1 << endl;
cout << "Enter the 2nd number: ";
cin >> num2;
cout << " " << num2 << endl;
cout << "Enter the 3rd number: ";
cin >> num3;
cout << " " << num3;
// Calculate the sum using + operator
// and store it in variable sum
sum = num1 + num2 + num3;
// Print the sum
cout << "\nSum of the 3 numbers is: "
<< sum;
return 0;
}
// This code is contributed by shivanisinghss211
Output
Enter num1: 0
Enter num2: 0
Enter num3: -145269
The sum: -145269
Priori Analysis
From the word prior or before, priori analysis involves checking an algorithm before its implementation (Wang & Zhou, 2022). This demands that the algorithm is reviewed when it is written in theoretical steps. An algorithm’s efficiency is measured by assuming that all other factors, including the processor speed, are held constant and have no impact on the implementation. Hence, it is the method through which the Algorithm Complexity is determined, and an algorithm designer usually undertakes it.
Posteriori Analysis
Posteriori analysis is checking the algorithm after implementation has occurred (Wang & Zhou, 2022). The algorithm checks through implementation and execution via a programming language. It enables an algorithm designer to obtain an accurate and factual analysis report concerning the correctness, time used, and space required, among other variables. The time factor is determined by counting the total critical operations, including comparisons in the sorting algorithm. On the other hand, the space factor is valued by determining the maximum amount of memory the algorithm needs.
Space Complexity
The amount of memory required by an algorithm to execute and get results is referred to as space complexity. The memory requirements, in this case, can be for inputs, outputs, or temporary operations.
Calculating Space Complexity
The space complexity is calculated by determining the fixed and variable parts. The fixed refers to the definite space required by the algorithm, including input variables, output variables, and program size. However, the Variable part refers to the area that can be different based on the implementation of the algorithm, including dynamic memory allocation, temporary variables, and recursion stack space.
Time Complexity
Time complexity refers to the duration required by the algorithm to execute and get results (Asif et al., 2019). Time complexity can be for loop statements, conditional statements and normal operations.
Calculating Time Complexity
The two components to be considered in time complexity include the constant time part and variable time part (Asif et al., 2019). The former consists of instructions executed on a one-time basis, such as input, output, switch, and if-else. T...
Get the Whole Paper!
Not exactly what you need?
Do you need a custom essay? Order right now:
Other Topics:
- Poorly Designed Website AnalysisDescription: Arngren is Norway-based online e-commerce that deals with sales of various products such as electronics, hobby items, and other gadgets. Customer purchases goods online and they are delivered via mail order. It is one of the companies that has a poorly designed website....1 page/≈275 words| 1 Source | Harvard | IT & Computer Science | Essay |
- Dark Web IT & Computer Science Essay Research PaperDescription: The dark web seems to be a good thing that can bring some positivity into humanity. However, even if that is the case, more effort should not be expended to enable more comprehensive access to the dark web. The consequences of doing that will automatically supersede its benefit....2 pages/≈550 words| 2 Sources | Harvard | IT & Computer Science | Essay |
- X.509 PKI and Open PGP’s PKI IT & Computer Science EssayDescription: In cryptography, X.509 is an ITU-T standard for establishment of a Public Key Infrastructure (PKI) and Privilege Management Infrastructure (PMI). It includes many standard formats like public key certificates, attribute certificates, certificate path validation algorithms etc. Open PGP’s PKI...1 page/≈550 words| 4 Sources | Harvard | IT & Computer Science | Essay |