logo

Algorithm vs Code: Understanding the Relationship and Process

   

Added on  2023-02-02

36 Pages7367 Words30 Views
Unit 1 Programming
By Jacob Brown
Student ID 19004359
Pearson ID PD01969
Algorithm vs Code: Understanding the Relationship and Process_1
1
Table of Contents
Introduction...........................................................................................................................................2
Algorithms process in building an application.......................................................................................5
The relationship between algorithms and code....................................................................................6
The generation process of code............................................................................................................7
Comparing Algorithm and Code..........................................................................................................12
Conclusion...........................................................................................................................................14
Relationships.......................................................................................................................................19
Comparing procedural, object oriented, and event drive program.....................................................20
Critical object-orientated and occasion driven standards, as far as the code construction and
qualities...............................................................................................................................................20
Examples Of Python Program/IDLE.....................................................................................................23
Evaluate IDE.........................................................................................................................................26
Debugging process..............................................................................................................................26
Types of errors programs....................................................................................................................27
Guild for Python..................................................................................................................................29
Example Of Debugging........................................................................................................................30
Coding Standards.................................................................................................................................31
Coding standards are needed for both teams and individuals............................................................34
Conclusion...........................................................................................................................................34
References...........................................................................................................................................34
Algorithm vs Code: Understanding the Relationship and Process_2
2
Introduction.
Algorithm in programming.
A procedure for tending to a well registering issue is known as a calculation. It requires information
on the numerous choices for resolving a computational issue, just as the equipment, organizing,
programming language, and execution limitations that accompany every choice. In software
engineering, a calculation is an assortment of guidelines that permits a PC to play out any
assignment, for example, working a PC or shooting a rocket. At their heart, PC programs are
calculations communicated in programming dialects that the machine gets it.
Purpose
Algorithms are basically problem solvers, regardless of the context in which they are employed; their
goal is to solve and, in many cases, automate a solution to a specific problem. Algorithm textbooks
often give a general overview of the subject, describing an algorithm as a series of steps to complete
a job. Algorithms are used to solve and, in many cases, automate a problem's solution. Five
conditions must be satisfied to qualify anything as an algorithm, according to one usable definition:
inputs, outputs, finiteness, and effectiveness are all terms that may be used to describe definiteness,
inputs, outputs, and effectiveness. Algorithms play an important role in healthcare. There is
presently no legal definition for algorithms. The lack of a precise definition in the legislation may
leave algorithm management on unstable ground, a problem that the PHG Foundation is tackling
with the project Regulating Algorithms in Healthcare. In space search programs, the employment of
computer algorithms is crucial. We are living in the era of algorithms because they solve our daily
duties, and we will be unable to exist without them. They make our lives easier, and they will be able
to anticipate our behaviour in the future.
How Does It Work
For those of us who aren't programmers, and calculation is an assortment of guidelines that take an
information, A, and produce a result, B, that alters the information somehow or another.
Calculations might be utilized in a wide scope of circumstances. They can aid the estimation of
capacities from focuses in an information collection, among other things, in arithmetic.
Algorithm vs Code: Understanding the Relationship and Process_3
3
Benefits
Algorithm
Benefits:
1. It is a straightforward bit by bit portrayal of an answer for a specific issue.
2. A calculation follows a specific technique.
3. It did not depend on any programming language, simplifying it to get a handle on for
anyone, incorporating those with no programming experience.
4. Since each progression in a calculation has its own coherent arrangement, it is easy to
investigate.
5. Since the issue is separated into more modest pieces or stages by using a calculation,
it is more straightforward for a software engineer to change it into a genuine program.
Disadvantages:
1. Calculations set aside effort to create.
2. It is hard to exhibit Branching and Looping in Algorithms.
3. It is hard to incorporate huge positions into Algorithms.
Code in programming
Code is a bunch of rules utilized in interchanges and data handling to change data like a letter, word,
sound, picture, or signal into another structure, in some cases curtailed or secret, for transmission
across a correspondence direct or capacity in a capacity media.
Purpose
A code supports moral and consistence conversations, giving laborers the gadgets, they need to
oversee moral issues they face at work. It can likewise be utilized as a source of perspective
instrument, helping laborers in finding significant papers, administrations, and different morals
related assets inside the organization.
Algorithm vs Code: Understanding the Relationship and Process_4
4
How it Works
Almost every programming language follows the same pattern: You write code to instruct it on what
to do, such as print ("Hello, world"). The code is compiled, which converts it into computer-readable
machine code. The computer runs the code and responds with Hello, world.
Bubble sort, otherwise called sinking sort, is an essential arranging calculation that repeats through a
rundown, contrasting close by passages and trading them in case they are messed up. The rundown
is passed however over and over until it is arranged.
How does it Work
A bubble sort algorithm iterates over a list of data, contrasting two things next to each other with
figure out which is messed up. It will continue to run over the rundown of information until it has
sorted everything into the correct order. A 'pass' is the number of times the algorithm passes over
the list.
Steps
1. Sort by bubbles
2. Begin with the first item on the list.
2. Compare the first value in the list to the next item in the list. Swap the places of the two integers if
first 3. value is larger.
4. Go to the second item on the list...
5. Continue comparing objects until there are none left to compare.
6. Return to the beginning of the list.
Algorithm vs Code: Understanding the Relationship and Process_5
5
Algorithms process in building an application.
Add two numbers
1. Step 1 Enter/Start
2. Step 2 input number 1 and 2
3. Step 3 add number 1 and 2
4. Step 4 display sum
5. End/Stop
Flowchart Example
Algorithm vs Code: Understanding the Relationship and Process_6
6
The relationship between algorithms and code.
Algorithm vs Code: Understanding the Relationship and Process_7
7
Algorithm
A recipe is what an algorithm is. It could be written in simple English. It's a strategy for achieving a
goal. It has the potential to be efficient.
If you're trying to predict a number between 0 and 100 based on cues like "too high" or "too low,"
for example, you might start at 0 and work your way up one step at a time. This would give you the
proper result, but it would take a long time. Alternatively, you may start with 50 and always strive
for the middle of the valid range; for example, if the answer is too high, go on to 25, and you'll get
the proper number in less steps.
An algorithm's equation can be written analytically. You can evaluate an algorithm with only a pen
and paper or by talking about it out loud.
Code
Then there's the matter of coding. A programming language is always used to write code. For every
sizeable program, code will implement multiple algorithms, generally more than one, in order to
execute various jobs, unless it’s entirely random and provides no use.
The term "implement" simply refers to the process of translating an algorithm into computer code.
However, there are other methods for performing this translation. You might, for example, use
alternative variable names. You may package the code in a variety of ways, such as by defining
reusable functions, dividing the functions into modules, and so on. At that level, a great deal of
craftsmanship is required to keep the code legible and manageable.
The generation process of code.
The interaction by which a compiler's code generator changes some widely appealing depiction of
source code into a construction e.g., machine code that can be successfully executed by a machine is
known as code age in computing. Multiple passes are usually performed by sophisticated compilers
across numerous intermediate forms.
Algorithm vs Code: Understanding the Relationship and Process_8

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Case Study: Wage Commission Application Development
|28
|5209
|493

Algorithm Theory and Programming Paradigms
|31
|6478
|184

Assignment on Algorithms And Programming
|27
|4937
|106

Unit 1: Programming Submission PDF
|36
|7565
|62

Characteristics of Programming
|18
|3047
|208