Comprehensive Report: Programming Algorithms, IDEs, and Debugging
VerifiedAdded on 2024/05/29
|28
|4336
|358
Report
AI Summary
This report provides a comprehensive overview of programming algorithms and application development using Python. It defines basic algorithms, outlines the programming process, and explains procedural, object-oriented, and event-driven programming paradigms. The report includes an analysis of a suitable Integrated Development Environment (IDE), along with the implementation of basic algorithms in code using IDLE. It also details the debugging process and emphasizes the importance of coding standards, providing examples and explanations for each concept. The document includes flowcharts and code snippets to illustrate various algorithms, such as array summation and a bouncing ball game, highlighting the practical application of programming principles. Desklib offers this and many other solved assignments to aid students in their studies.

Programming
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Table of Contents
Introduction...........................................................................................................................................2
LO1 Define basic algorithms to carry out an operation and outline the process of programming an
application.............................................................................................................................................2
[M1]...................................................................................................................................................5
LO2 Explain the characteristics of procedural, object-orientated and event driven programming,
conduct an analysis of a suitable Integrated Development Environment (IDE).....................................7
LO3 Implement basic algorithms in code using an IDE........................................................................11
[M3].................................................................................................................................................18
LO4 Determine the debugging process and explain the importance of a coding standard................18
[P4]..................................................................................................................................................18
[P5]..................................................................................................................................................21
Conclusion...........................................................................................................................................23
References...........................................................................................................................................24
List of Figures
Figure 1 flowchart..................................................................................................................................6
Figure 2 Bouncing ball game flowchart.................................................................................................8
Figure 3 Comparison Table..................................................................................................................12
Figure 4 To find area and perimeter of rectangle................................................................................13
Figure 5 For calculating journey time..................................................................................................14
Figure 6 For result analysis..................................................................................................................15
Figure 7 To generate random numbers...............................................................................................16
Figure 8 Calculate sum of array elements............................................................................................16
Figure 9 To calculate total bounces.....................................................................................................17
Figure 10 To generate questions.........................................................................................................18
Figure 11 To generate questions (remaining code).............................................................................19
1
Introduction...........................................................................................................................................2
LO1 Define basic algorithms to carry out an operation and outline the process of programming an
application.............................................................................................................................................2
[M1]...................................................................................................................................................5
LO2 Explain the characteristics of procedural, object-orientated and event driven programming,
conduct an analysis of a suitable Integrated Development Environment (IDE).....................................7
LO3 Implement basic algorithms in code using an IDE........................................................................11
[M3].................................................................................................................................................18
LO4 Determine the debugging process and explain the importance of a coding standard................18
[P4]..................................................................................................................................................18
[P5]..................................................................................................................................................21
Conclusion...........................................................................................................................................23
References...........................................................................................................................................24
List of Figures
Figure 1 flowchart..................................................................................................................................6
Figure 2 Bouncing ball game flowchart.................................................................................................8
Figure 3 Comparison Table..................................................................................................................12
Figure 4 To find area and perimeter of rectangle................................................................................13
Figure 5 For calculating journey time..................................................................................................14
Figure 6 For result analysis..................................................................................................................15
Figure 7 To generate random numbers...............................................................................................16
Figure 8 Calculate sum of array elements............................................................................................16
Figure 9 To calculate total bounces.....................................................................................................17
Figure 10 To generate questions.........................................................................................................18
Figure 11 To generate questions (remaining code).............................................................................19
1

Figure 12 Exit function.........................................................................................................................19
Figure 13 Debugging tools...................................................................................................................21
Figure 14 Setting breakpoint...............................................................................................................21
Figure 15 Breakpoint set......................................................................................................................22
Figure 16 Multi line comments............................................................................................................24
Figure 17 Single line comments...........................................................................................................24
2
Figure 13 Debugging tools...................................................................................................................21
Figure 14 Setting breakpoint...............................................................................................................21
Figure 15 Breakpoint set......................................................................................................................22
Figure 16 Multi line comments............................................................................................................24
Figure 17 Single line comments...........................................................................................................24
2
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Introduction
The assignment consists of the programs written in python. We will be using the platform IDLE for
developing the project. The IDLE provides effective methods of error handling and also provides easy
implementations. With these programs we will be developing a good understanding of the python.
There are a total of eight programs implementations in our task. This whole assignment is divided
into various tasks like M1, M2, M3 and M4. Each sub task have its own importance in developing the
understanding of the python. The evidences of the implementations are attached with this
assignment.
3
The assignment consists of the programs written in python. We will be using the platform IDLE for
developing the project. The IDLE provides effective methods of error handling and also provides easy
implementations. With these programs we will be developing a good understanding of the python.
There are a total of eight programs implementations in our task. This whole assignment is divided
into various tasks like M1, M2, M3 and M4. Each sub task have its own importance in developing the
understanding of the python. The evidences of the implementations are attached with this
assignment.
3
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

LO1 Define basic algorithms to carry out an operation and outline the process
of programming an application
An arrangement of principles is an appropriately requested method for dealing with an issue. It
includes set of proposals. For any inconvenience there might be more than 1 arrangement and at
last it could have in additional of one algorithm. The arrangement of principles connected for dealing
with the trouble ought to be adequately effective that it can enhance the course of action. The
arrangement of guidelines should be organize loosened and isolated from this the arrangement of
principles need to have scarcest zone and time unpredictability. Typical tongues, flowcharts, and
pseudo codes etcetera are used to converse with the algorithms (Edrawsoft.com, n.d.).
Types of algorithm:
1. Simple recursive algorithm: This divides a problem in many subordinate problems and also
repeats many times.
2. Backtracking algorithm: It back tracks the path travelled in finding the best suitable solution.
If no solution is found then failure will be returned.
3. Dynamic programming algorithm: It uses old results to find new solutions of the problem.
4. Greedy algorithm: This algorithm works in two phases and finds the best suitable solution.
It finds the global and local optimum. When it finds the best solution only then it proceeds
further.
5. Binary Tree lookup: It uses sorted binary tree. This consists of three cases:
It the key value is bigger then it will use right sub-tree for lookup.
If the key value is smaller then it will use left sub-tree for lookup.
If it returns success only if the value of keys are equal.
This process will repeat until success is returned.
6. Divide and conquer: This works in two phases:
Conquer: It integrates the results of sub problems generated in the phase of divide.
Divides: It divides the problem in sub-problems and then finds their individual
solutions.
7. Branch and bound method: It builds lower and upper bounds to optimise a problem's
solution.
8. Randomised algorithm: For taking necessary solutions, it makes use of random values.
4
of programming an application
An arrangement of principles is an appropriately requested method for dealing with an issue. It
includes set of proposals. For any inconvenience there might be more than 1 arrangement and at
last it could have in additional of one algorithm. The arrangement of principles connected for dealing
with the trouble ought to be adequately effective that it can enhance the course of action. The
arrangement of guidelines should be organize loosened and isolated from this the arrangement of
principles need to have scarcest zone and time unpredictability. Typical tongues, flowcharts, and
pseudo codes etcetera are used to converse with the algorithms (Edrawsoft.com, n.d.).
Types of algorithm:
1. Simple recursive algorithm: This divides a problem in many subordinate problems and also
repeats many times.
2. Backtracking algorithm: It back tracks the path travelled in finding the best suitable solution.
If no solution is found then failure will be returned.
3. Dynamic programming algorithm: It uses old results to find new solutions of the problem.
4. Greedy algorithm: This algorithm works in two phases and finds the best suitable solution.
It finds the global and local optimum. When it finds the best solution only then it proceeds
further.
5. Binary Tree lookup: It uses sorted binary tree. This consists of three cases:
It the key value is bigger then it will use right sub-tree for lookup.
If the key value is smaller then it will use left sub-tree for lookup.
If it returns success only if the value of keys are equal.
This process will repeat until success is returned.
6. Divide and conquer: This works in two phases:
Conquer: It integrates the results of sub problems generated in the phase of divide.
Divides: It divides the problem in sub-problems and then finds their individual
solutions.
7. Branch and bound method: It builds lower and upper bounds to optimise a problem's
solution.
8. Randomised algorithm: For taking necessary solutions, it makes use of random values.
4

9. Brute force algorithm: This finds acceptable solutions of the problem.
Flowchart is a diagrammatic depiction of the relationship of an issue. Every movement connected as
a major aspect of the procedure is addressed with the guide of a trade photograph. For each
improvement there might be a predefined picture that delineates the kind of movement on the
strategy (Hebb, n.D.). The going with is the flowchart photographs which are most extreme typically
connected:
I. Decision: The symbol of the shape of diamond is used when representing a decision.
II. Terminator: The symbol of the shape of oval is used when indicating the ending or start of a
process.
III. Document: The report is indicated through a document.
IV. Process: The symbol of the shape of rectangle is used when indicating the flow of process.
V. Data: The symbol of the shape of parallelogram is used when indicating the output or input
of the process.
A honest flowchart is respected underneath with its as a general rule used naming conventions. The
flowcharts are the simplest strategy for depiction of a way. It addresses the stream of execution in a
very much requested way. They make the understanding of the count broadly less irritating. One can
without a lot of an extend douse up a count by methods for making utilization of these move traces.
The working of prohibitive decrees and circles are in addition results easily addressed by using
flowcharts. Along these lines it is always endorsed to incorporate flowchart with the codes so the
benefactor can perceive the depictions move of the computation used.
5
Flowchart is a diagrammatic depiction of the relationship of an issue. Every movement connected as
a major aspect of the procedure is addressed with the guide of a trade photograph. For each
improvement there might be a predefined picture that delineates the kind of movement on the
strategy (Hebb, n.D.). The going with is the flowchart photographs which are most extreme typically
connected:
I. Decision: The symbol of the shape of diamond is used when representing a decision.
II. Terminator: The symbol of the shape of oval is used when indicating the ending or start of a
process.
III. Document: The report is indicated through a document.
IV. Process: The symbol of the shape of rectangle is used when indicating the flow of process.
V. Data: The symbol of the shape of parallelogram is used when indicating the output or input
of the process.
A honest flowchart is respected underneath with its as a general rule used naming conventions. The
flowcharts are the simplest strategy for depiction of a way. It addresses the stream of execution in a
very much requested way. They make the understanding of the count broadly less irritating. One can
without a lot of an extend douse up a count by methods for making utilization of these move traces.
The working of prohibitive decrees and circles are in addition results easily addressed by using
flowcharts. Along these lines it is always endorsed to incorporate flowchart with the codes so the
benefactor can perceive the depictions move of the computation used.
5
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Figure 1 flowchart
In problem 1.7,
The problem is to find the addition of the elements of array. The input to the problem will be the
elements of an array and the solution of which will return the output as addition of the araay.
The algorithm will be as under:
Input: Elements of array
Output: Addition of the elements of array
Algorithm:
I. Start
6
In problem 1.7,
The problem is to find the addition of the elements of array. The input to the problem will be the
elements of an array and the solution of which will return the output as addition of the araay.
The algorithm will be as under:
Input: Elements of array
Output: Addition of the elements of array
Algorithm:
I. Start
6
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

II. initialise array
III. Then initialise a function name arraySum() to add the elements.
IV. Let a variable sum=0
V. Insert a for loop to adding elements.
VI. Sum of elements will be performed.
VII. Return the variable sum which consists of the sum of elements.
VIII. Exit
[M1]
This case involves a ball weaving relaxation. The ball stops ricocheting if the stature is beneath
0.5cm. It is given that each time the ball skips it extensions to the 70% of the past stature. We have
to parent the no. Of times it ricochets sooner than the delight closes. We will give the commitment
to the estimation as the basic stature (in cm) and it will repair the no. Of weaves.
Input to the algorithm: Height (cm)
Output: Total bounces done by the ball
Algorithm:
I. Start
II. Let a variable heightLimit=0.5
III. Then initialise bounceGame() function.
IV. Input height
V. Let a variable of the name Letbounces=0
VI. Insert while loop for comparison for heights
VII. Determine total bounces.
VIII. Output the total bounces done by ball
IX. Exit
7
III. Then initialise a function name arraySum() to add the elements.
IV. Let a variable sum=0
V. Insert a for loop to adding elements.
VI. Sum of elements will be performed.
VII. Return the variable sum which consists of the sum of elements.
VIII. Exit
[M1]
This case involves a ball weaving relaxation. The ball stops ricocheting if the stature is beneath
0.5cm. It is given that each time the ball skips it extensions to the 70% of the past stature. We have
to parent the no. Of times it ricochets sooner than the delight closes. We will give the commitment
to the estimation as the basic stature (in cm) and it will repair the no. Of weaves.
Input to the algorithm: Height (cm)
Output: Total bounces done by the ball
Algorithm:
I. Start
II. Let a variable heightLimit=0.5
III. Then initialise bounceGame() function.
IV. Input height
V. Let a variable of the name Letbounces=0
VI. Insert while loop for comparison for heights
VII. Determine total bounces.
VIII. Output the total bounces done by ball
IX. Exit
7

Figure 2 Bouncing ball game flowchart
8
8
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

LO2 Explain the characteristics of procedural, object-orientated and event
driven programming, conduct an analysis of a suitable Integrated
Development Environment (IDE)
Procedural programming:
It is a standout amongst the most settled techniques for programming and it is the kind of
programming that a developing clothier is well at the way to learn at first. What Procedural
Programming fundamentally suggests is that we code the work that we require the machine to do in
honest method which involve essential computational advances that might be effectively
understood by means of the framework and from this time forward, making it a concise system for
programming. Procedural Programming is for the most extreme component connected as a piece of
enormous scale wanders wherein following points of interest are by and large imperative:
1. We can re-call it if required.
2. It follows easy pattern of logic
3. Easy to keep track.
Procedural Programming is immovably related to Imperative Programming in the end, each
improvement that a gadget comprises of is unequivocally portrayed.
Also, procedural programming uses limits, yet that in any sense would not imply that it's far mixed
halfway with utilitarian programming in light of the way that those limits are in some other case
called 'Set away Procedures'. From this time forward, making it best Procedural Programming.
Pros of Procedural programming are:
1. Simple than other languages.
2. It allows reusability of the codes. This can be done without copying the codes.
3. Easy to understand.
4. It follows structured programming pattern.
5. Allows programmers to do concise programming.
Use:
It is used in certain languages like: BASIC, C, FORTRAN, Pascal etc.
9
driven programming, conduct an analysis of a suitable Integrated
Development Environment (IDE)
Procedural programming:
It is a standout amongst the most settled techniques for programming and it is the kind of
programming that a developing clothier is well at the way to learn at first. What Procedural
Programming fundamentally suggests is that we code the work that we require the machine to do in
honest method which involve essential computational advances that might be effectively
understood by means of the framework and from this time forward, making it a concise system for
programming. Procedural Programming is for the most extreme component connected as a piece of
enormous scale wanders wherein following points of interest are by and large imperative:
1. We can re-call it if required.
2. It follows easy pattern of logic
3. Easy to keep track.
Procedural Programming is immovably related to Imperative Programming in the end, each
improvement that a gadget comprises of is unequivocally portrayed.
Also, procedural programming uses limits, yet that in any sense would not imply that it's far mixed
halfway with utilitarian programming in light of the way that those limits are in some other case
called 'Set away Procedures'. From this time forward, making it best Procedural Programming.
Pros of Procedural programming are:
1. Simple than other languages.
2. It allows reusability of the codes. This can be done without copying the codes.
3. Easy to understand.
4. It follows structured programming pattern.
5. Allows programmers to do concise programming.
Use:
It is used in certain languages like: BASIC, C, FORTRAN, Pascal etc.
9
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

OOPS:
It stands for object oriented programming. Object Oriented Programming transformed into
delivered to crush the few dangers of old programming strategies (i.E., Procedural Programming).
This programming approach tried the standard strategy for coding which accumulated additional at
the reason (or the technique to comprehend this framework) rather than the certainties itself on
which this framework is to be performed.
Object Oriented Programming uses gadgets* which by then chat with each extraordinary inside the
product by means of passing messages to request organizations.
Objects:
An Object is a depiction of genuine detail in an application and is a social affair of homogeneous
records that is collected underneath a classification.
A challenge has states (records) and practices (strategies) to perform exercises.
Advantages of object oriented programming languages over procedural programming languages are
as under:
1. Program Maintenance: This favoured perspective of Object-Oriented Programming makes it
exceptionally solid and simple to-artistic creations with than Procedural Programming. In
Procedural Programming an essential Top-Down Design is taken after to take care of the
issues which get to a great degree frustrated while you reveal a change at the best factor of
that chain considering then it impacts the entire program and some of the time designer
wants to re-form the total program. While, in OOP this isn't the situation considering that
privilege here we use Classes and Objects that take out this condition certainly and save an
astounding arrangement of time and effort.
2. Polymorphism: For a certified OOP Language Polymorphism is discernibly required.
Polymorphism basically suggests that a challenge or a variable or a limit may have distinctive
frameworks and a Polymorphism-engaged vernacular may then have the capacity to
comprehend those different frameworks and select which one to use on the period of
execution. For example – if a variable is given an entire assortment regard then it would
attempt it to facilitate it with the specialist's range in the meantime as though that variable
is given a string regard then it would venture to organize it with the expert's name.
10
It stands for object oriented programming. Object Oriented Programming transformed into
delivered to crush the few dangers of old programming strategies (i.E., Procedural Programming).
This programming approach tried the standard strategy for coding which accumulated additional at
the reason (or the technique to comprehend this framework) rather than the certainties itself on
which this framework is to be performed.
Object Oriented Programming uses gadgets* which by then chat with each extraordinary inside the
product by means of passing messages to request organizations.
Objects:
An Object is a depiction of genuine detail in an application and is a social affair of homogeneous
records that is collected underneath a classification.
A challenge has states (records) and practices (strategies) to perform exercises.
Advantages of object oriented programming languages over procedural programming languages are
as under:
1. Program Maintenance: This favoured perspective of Object-Oriented Programming makes it
exceptionally solid and simple to-artistic creations with than Procedural Programming. In
Procedural Programming an essential Top-Down Design is taken after to take care of the
issues which get to a great degree frustrated while you reveal a change at the best factor of
that chain considering then it impacts the entire program and some of the time designer
wants to re-form the total program. While, in OOP this isn't the situation considering that
privilege here we use Classes and Objects that take out this condition certainly and save an
astounding arrangement of time and effort.
2. Polymorphism: For a certified OOP Language Polymorphism is discernibly required.
Polymorphism basically suggests that a challenge or a variable or a limit may have distinctive
frameworks and a Polymorphism-engaged vernacular may then have the capacity to
comprehend those different frameworks and select which one to use on the period of
execution. For example – if a variable is given an entire assortment regard then it would
attempt it to facilitate it with the specialist's range in the meantime as though that variable
is given a string regard then it would venture to organize it with the expert's name.
10

3. Inheritance: This possessions of Object-Oriented Programming enables the product program
specialist to re-use their code without composing it a couple of times in a comparable
programming. This is accomplished by method for making sub-directions of a top notch
class, alluded to as child class and gaining the homes of the parent class, which incorporates
strategies and data, yet repressions might be constrained at the properties that should be
spared private.
4. Encapsulation: This great position enables the designer to make utilization of inquiries in
OOP, which incorporate data without revealing it to the program. In spite of the fact that in
Procedural Programming there are no such things as articles and every last one of the data is
totally exhibited to the program. This property of hiding records is likewise an essential run
of OOP.
Event driven programming:
The mammoth lion's share of the projects in this point in time are made with Event-Driven
Programming. Such applications just react when the customer gives a measurements and this
data might be something, running from a mouse snap to a substance creation.
Event Driven undertakings might be created in any programming vernacular however bizarre
nation programming lingos, for instance, Clojure & Visual Basic are greatest appropriate for
Event-Driven Programming on account that they convey irregular state consultations.
An occasion driven programming is exceptionally expected to perceive occasions with the help
of occasion driven system as they happen.
Why is Event driven programming better?
This is because,
1. We can realize Event-Driven Programming using gear thwarts by method for which we can
bring down the quality utilized by PC.
2. All propelled GUI's use Event-Driven Programming. By utilizing Event-Driven Programming
we can make sensible activities.
3. Event Driven Programming enables sensors and gadget to collaborate with programming.
We can without a terrible part of an extend make utilization of sensors and gadget from our
item with the help of Event-Driven Programming.
11
specialist to re-use their code without composing it a couple of times in a comparable
programming. This is accomplished by method for making sub-directions of a top notch
class, alluded to as child class and gaining the homes of the parent class, which incorporates
strategies and data, yet repressions might be constrained at the properties that should be
spared private.
4. Encapsulation: This great position enables the designer to make utilization of inquiries in
OOP, which incorporate data without revealing it to the program. In spite of the fact that in
Procedural Programming there are no such things as articles and every last one of the data is
totally exhibited to the program. This property of hiding records is likewise an essential run
of OOP.
Event driven programming:
The mammoth lion's share of the projects in this point in time are made with Event-Driven
Programming. Such applications just react when the customer gives a measurements and this
data might be something, running from a mouse snap to a substance creation.
Event Driven undertakings might be created in any programming vernacular however bizarre
nation programming lingos, for instance, Clojure & Visual Basic are greatest appropriate for
Event-Driven Programming on account that they convey irregular state consultations.
An occasion driven programming is exceptionally expected to perceive occasions with the help
of occasion driven system as they happen.
Why is Event driven programming better?
This is because,
1. We can realize Event-Driven Programming using gear thwarts by method for which we can
bring down the quality utilized by PC.
2. All propelled GUI's use Event-Driven Programming. By utilizing Event-Driven Programming
we can make sensible activities.
3. Event Driven Programming enables sensors and gadget to collaborate with programming.
We can without a terrible part of an extend make utilization of sensors and gadget from our
item with the help of Event-Driven Programming.
11
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 28
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.