Python Programming Assignment: Algorithm, IDE, and Debugging
VerifiedAdded on 2024/05/21
|36
|4030
|413
Report
AI Summary
This Python programming assignment solution provides a comprehensive overview of algorithm implementation using the IDLE IDE. It begins by defining algorithms and outlining the application development process, including a flowchart representation. The report then explains procedural, object-oriented, and event-driven programming paradigms, followed by an analysis of the IDLE IDE and Visual Studio 2017. The core of the assignment involves implementing basic algorithms in Python code within the IDLE environment, including screenshots of the source code and output. Furthermore, the debugging process is detailed, with explanations of debugging facilities available in IDLE, accompanied by illustrative figures. Finally, the assignment outlines the coding standards used, including single-line and multi-line comments, and the use of blank lines for readability. Desklib provides this and many other solved assignments for students.

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

Table of Contents
List of figures..............................................................................................................................................3
Introduction.................................................................................................................................................4
LO1 Define basic algorithms to carry out an operation and outline the process of programming an
application...................................................................................................................................................5
P1 Provide a definition of what an algorithm is and outline the process of building an application
.................................................................................................................................................................5
M1...........................................................................................................................................................5
LO2 Explain the characteristics of procedural, object-orientated and event-driven programming, conduct
an analysis of a suitable Integrated Development Environment (IDE)........................................................8
P2:...........................................................................................................................................................8
M2.........................................................................................................................................................11
LO3 Implement basic algorithms in code using an IDE............................................................................13
P3 Write a program that implements an algorithm using an IDE...................................................13
M3.........................................................................................................................................................27
LO4 Determine the debugging process and explain the importance of a coding standard.........................28
P4: Explain the debugging process and explain the debugging facilities available in the IDE
(visual studio 2017 or IDLE)...............................................................................................................28
P5: Outline the coding standard you have used in your code...........................................................32
Conclusion.................................................................................................................................................34
References.................................................................................................................................................35
1
List of figures..............................................................................................................................................3
Introduction.................................................................................................................................................4
LO1 Define basic algorithms to carry out an operation and outline the process of programming an
application...................................................................................................................................................5
P1 Provide a definition of what an algorithm is and outline the process of building an application
.................................................................................................................................................................5
M1...........................................................................................................................................................5
LO2 Explain the characteristics of procedural, object-orientated and event-driven programming, conduct
an analysis of a suitable Integrated Development Environment (IDE)........................................................8
P2:...........................................................................................................................................................8
M2.........................................................................................................................................................11
LO3 Implement basic algorithms in code using an IDE............................................................................13
P3 Write a program that implements an algorithm using an IDE...................................................13
M3.........................................................................................................................................................27
LO4 Determine the debugging process and explain the importance of a coding standard.........................28
P4: Explain the debugging process and explain the debugging facilities available in the IDE
(visual studio 2017 or IDLE)...............................................................................................................28
P5: Outline the coding standard you have used in your code...........................................................32
Conclusion.................................................................................................................................................34
References.................................................................................................................................................35
1

List of figures
Figure 1 Flowchart......................................................................................................................................8
Figure 2 Part 1 of program........................................................................................................................13
Figure 3Part 2 of program.........................................................................................................................14
Figure 4Part 3 of program.........................................................................................................................14
Figure 5Part 4 of program.........................................................................................................................15
Figure 6Part 5 of program.........................................................................................................................16
Figure 7Part 6 of program.........................................................................................................................17
Figure 8Part 7 of program.........................................................................................................................18
Figure 9Part 8 of program.........................................................................................................................19
Figure 10 Menu system of program...........................................................................................................19
Figure 11 Task 1.1 output..........................................................................................................................20
Figure 12Task 1.2 output...........................................................................................................................20
Figure 13Task 1.3 output...........................................................................................................................21
Figure 14Task 1.4 output...........................................................................................................................21
Figure 15Task 1.5 output...........................................................................................................................22
Figure 16Task 1.6 output...........................................................................................................................23
Figure 17Task 1.7 output...........................................................................................................................23
Figure 18Task 1.8 output...........................................................................................................................24
Figure 19Task 1.9 output...........................................................................................................................25
Figure 20Task 1.10 output.........................................................................................................................25
Figure 21 Validation applied in marks.......................................................................................................26
Figure 22 Validation applied in speed.......................................................................................................26
Figure 23 Validation applied in time.........................................................................................................27
Figure 24 Step 1........................................................................................................................................28
Figure 25 Step 2........................................................................................................................................29
Figure 26 Step 3........................................................................................................................................30
Figure 27 Step 7........................................................................................................................................31
Figure 28 Coding standard 1......................................................................................................................32
Figure 29 Single line comment..................................................................................................................32
Figure 30Multi-line comment....................................................................................................................33
Figure 31 Blank lines.................................................................................................................................33
2
Figure 1 Flowchart......................................................................................................................................8
Figure 2 Part 1 of program........................................................................................................................13
Figure 3Part 2 of program.........................................................................................................................14
Figure 4Part 3 of program.........................................................................................................................14
Figure 5Part 4 of program.........................................................................................................................15
Figure 6Part 5 of program.........................................................................................................................16
Figure 7Part 6 of program.........................................................................................................................17
Figure 8Part 7 of program.........................................................................................................................18
Figure 9Part 8 of program.........................................................................................................................19
Figure 10 Menu system of program...........................................................................................................19
Figure 11 Task 1.1 output..........................................................................................................................20
Figure 12Task 1.2 output...........................................................................................................................20
Figure 13Task 1.3 output...........................................................................................................................21
Figure 14Task 1.4 output...........................................................................................................................21
Figure 15Task 1.5 output...........................................................................................................................22
Figure 16Task 1.6 output...........................................................................................................................23
Figure 17Task 1.7 output...........................................................................................................................23
Figure 18Task 1.8 output...........................................................................................................................24
Figure 19Task 1.9 output...........................................................................................................................25
Figure 20Task 1.10 output.........................................................................................................................25
Figure 21 Validation applied in marks.......................................................................................................26
Figure 22 Validation applied in speed.......................................................................................................26
Figure 23 Validation applied in time.........................................................................................................27
Figure 24 Step 1........................................................................................................................................28
Figure 25 Step 2........................................................................................................................................29
Figure 26 Step 3........................................................................................................................................30
Figure 27 Step 7........................................................................................................................................31
Figure 28 Coding standard 1......................................................................................................................32
Figure 29 Single line comment..................................................................................................................32
Figure 30Multi-line comment....................................................................................................................33
Figure 31 Blank lines.................................................................................................................................33
2
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Introduction
The Python programming language is an object-oriented, high level and interpreted language with
dynamic semantics. The Python language is used to design the data structure with dynamic typing and
dynamic binding. The syntax of python programming language is simple and easy to use. The python has
pre-installed library and modules.
In this assignment, an application will be made in python programming language using IDLE IDE. The
report will also be generated for the application developer. In the first section of the report, I have
explained what algorithm is and will also design algorithm for the application. In the next section of the
report, I will explain the object-oriented, event-driven and procedural paradigms. In the next section of
the report, I will develop the application in IDLE IDE. And in the last section of the report, I will explain
the debugging process and coding standard for python programming language.
3
The Python programming language is an object-oriented, high level and interpreted language with
dynamic semantics. The Python language is used to design the data structure with dynamic typing and
dynamic binding. The syntax of python programming language is simple and easy to use. The python has
pre-installed library and modules.
In this assignment, an application will be made in python programming language using IDLE IDE. The
report will also be generated for the application developer. In the first section of the report, I have
explained what algorithm is and will also design algorithm for the application. In the next section of the
report, I will explain the object-oriented, event-driven and procedural paradigms. In the next section of
the report, I will develop the application in IDLE IDE. And in the last section of the report, I will explain
the debugging process and coding standard for python programming language.
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
P1 Provide a definition of what an algorithm is and outline the process of building
an application
Algorithm:
The algorithm is defined as a set of instructions that is used to solve the problems and task. For solving a
single problem there can be more than one solution for a problem. The selected algorithm should be
efficient and the proposed solution should be optimized. The algorithm should have a feature that it
supports multiple platforms with many programming languages. The algorithm must be efficient in
memory (space) and time factors. The algorithm should be concise and should be efficient (math.uaa,
2017).
The algorithm of case seven:
Input in the program: Array elements.
Output: Sum of the array elements.
Algorithm steps:
a. START the program
b. Method is declare arraySum().
c. A variable arrayTotal is declared and initialized as zero.
d. And start loops and calculate the sum.
e. The sum is stored in an arrayTotal variable.
f. The sum is printed.
g. EXIT program.
M1
The algorithm of case eight
a. START the program.
b. Method is declare bounceGame().
c. The height is taken ass input from user and store in bouncingHeight variable.
4
the process of programming an application
P1 Provide a definition of what an algorithm is and outline the process of building
an application
Algorithm:
The algorithm is defined as a set of instructions that is used to solve the problems and task. For solving a
single problem there can be more than one solution for a problem. The selected algorithm should be
efficient and the proposed solution should be optimized. The algorithm should have a feature that it
supports multiple platforms with many programming languages. The algorithm must be efficient in
memory (space) and time factors. The algorithm should be concise and should be efficient (math.uaa,
2017).
The algorithm of case seven:
Input in the program: Array elements.
Output: Sum of the array elements.
Algorithm steps:
a. START the program
b. Method is declare arraySum().
c. A variable arrayTotal is declared and initialized as zero.
d. And start loops and calculate the sum.
e. The sum is stored in an arrayTotal variable.
f. The sum is printed.
g. EXIT program.
M1
The algorithm of case eight
a. START the program.
b. Method is declare bounceGame().
c. The height is taken ass input from user and store in bouncingHeight variable.
4

d. The value of bouncingHeight is allocated to remainingHeight variable.
e. The variable bounceNumber is declared and initialized to zero.
f. The while loop is started and loop run until remainingHeightos greater than 0.5.
g. The bounceNumber is incremented by one every time.
h. The remainingHeightis multiplied by 0.7.
i. bounceNumber is printed.
j. EXIT program.
Outline process
5
e. The variable bounceNumber is declared and initialized to zero.
f. The while loop is started and loop run until remainingHeightos greater than 0.5.
g. The bounceNumber is incremented by one every time.
h. The remainingHeightis multiplied by 0.7.
i. bounceNumber is printed.
j. EXIT program.
Outline process
5
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

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

Figure 1 Flowchart
LO2 Explain the characteristics of procedural, object-orientated
and event-driven programming, conduct an analysis of a suitable
Integrated Development Environment (IDE)
P2:
Procedural Paradigm is the oldest paradigm of the Object, Procedural and Event-driven Paradigm.
Procedural Paradigm is further enhanced into Object-Oriented Paradigm to improve some features that
lack in it and then came the event paradigm in the scene. Let us see what are the characteristics these
different paradigms.
• Procedural Paradigm: ‘Procedures’ are the main focus of this paradigm which is also sometimes
called functions. Procedures are the commands to be executed and it can be called from anywhere. The
best example of the language that uses this paradigm is C language.
Characteristics:
1. There are no effective techniques available to secure data of the function.
2. The large problems are distributed into smaller functions.
3. The top-down approach is being followed in program designing.
4. The global data is being shared in many functions.
5. Data move from function to function freely (Packtpub, 2017).
• Object-oriented Paradigm: Object-oriented Paradigm is an advanced version of Procedural
Paradigm. An object is being treated as the most important part here instead of procedure and thus it does
not allow data to freely flow around the system. The best example of the language that uses this paradigm
is C++, Java.
Characteristics:
7
LO2 Explain the characteristics of procedural, object-orientated
and event-driven programming, conduct an analysis of a suitable
Integrated Development Environment (IDE)
P2:
Procedural Paradigm is the oldest paradigm of the Object, Procedural and Event-driven Paradigm.
Procedural Paradigm is further enhanced into Object-Oriented Paradigm to improve some features that
lack in it and then came the event paradigm in the scene. Let us see what are the characteristics these
different paradigms.
• Procedural Paradigm: ‘Procedures’ are the main focus of this paradigm which is also sometimes
called functions. Procedures are the commands to be executed and it can be called from anywhere. The
best example of the language that uses this paradigm is C language.
Characteristics:
1. There are no effective techniques available to secure data of the function.
2. The large problems are distributed into smaller functions.
3. The top-down approach is being followed in program designing.
4. The global data is being shared in many functions.
5. Data move from function to function freely (Packtpub, 2017).
• Object-oriented Paradigm: Object-oriented Paradigm is an advanced version of Procedural
Paradigm. An object is being treated as the most important part here instead of procedure and thus it does
not allow data to freely flow around the system. The best example of the language that uses this paradigm
is C++, Java.
Characteristics:
7

1. Objects are the critical thing here while procedures or methods are in procedural paradigm.
2. The bottom-up approach in program designing is followed.
3. New data and functions can be created whenever and wherever needed.
4. Objects communicate through functions with other objects created.
5. Data cannot move freely around the system in this paradigm.
6. The procedure of an object can access and make changes in the data field of objects with which they
are connected.
7. The program here is distributed in between objects.
Features of the object-oriented paradigm are:
1. Objects i.e. it is an entity or a real-world element which has an identity that differentiates it from
other elements.
2. Classes i.e. blueprint or collection of objects is known as a class and an object is the instant of class.
3. Encapsulation i.e. is binding of objects and methods together in one place. You cannot access the
elements from outside the class until you use the interface.
4. Polymorphism i.e. it means many forms. When one function works in different ways with help of a
different number of attributes.
5. Inheritance i.e. improves the reusability. It means one class inherits another class and thus we can
reuse the features and methods of that class in new class. The parent class is called base class while the
inherited class is known as child class or derived class. “is-a” relationship is defined by it. There are five
different types of inheritance i.e. Single inheritance, multilevel inheritance, multiple inheritance, hybrid
inheritance and hierarchical inheritance.
6. Data Abstraction i.e. here only the relevant data is being shown by the programmer the rest is hidden.
7. Message passing i.e. objects communicates through each other by passing messages and invoking
methods present in the class(Rodriguez,2014).
8
2. The bottom-up approach in program designing is followed.
3. New data and functions can be created whenever and wherever needed.
4. Objects communicate through functions with other objects created.
5. Data cannot move freely around the system in this paradigm.
6. The procedure of an object can access and make changes in the data field of objects with which they
are connected.
7. The program here is distributed in between objects.
Features of the object-oriented paradigm are:
1. Objects i.e. it is an entity or a real-world element which has an identity that differentiates it from
other elements.
2. Classes i.e. blueprint or collection of objects is known as a class and an object is the instant of class.
3. Encapsulation i.e. is binding of objects and methods together in one place. You cannot access the
elements from outside the class until you use the interface.
4. Polymorphism i.e. it means many forms. When one function works in different ways with help of a
different number of attributes.
5. Inheritance i.e. improves the reusability. It means one class inherits another class and thus we can
reuse the features and methods of that class in new class. The parent class is called base class while the
inherited class is known as child class or derived class. “is-a” relationship is defined by it. There are five
different types of inheritance i.e. Single inheritance, multilevel inheritance, multiple inheritance, hybrid
inheritance and hierarchical inheritance.
6. Data Abstraction i.e. here only the relevant data is being shown by the programmer the rest is hidden.
7. Message passing i.e. objects communicates through each other by passing messages and invoking
methods present in the class(Rodriguez,2014).
8
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

• Event-driven Paradigm- In this paradigm, the flow of the program is depended on events such as
mouse click, messages from other threads etc.
Web Applications based on JavaScript and GUI use it. What all it can do is- develop, build, debug, test,
deploy, version control, DevOps, Performance Improvement.
Visual Studio support languages such as C#, C++, C, JavaScript, Visual Basic. It also works well with
third party application such as Cordova and Unity. It helps you to install the workloads and thus making it
lightweight than ever thus the installation performance has become better.
Characteristics of Event-driven paradigm:
1. Time-driven i.e. the code runs on time trigger at a specific time.
2. Service-oriented i.e. programs are written based on the services that are requested by the users.
3. Pre-defined Functions i.e. already built function, so that the code will run as soon as it is called.
4. Modularity i.e. different modules to carry out different tasks and each module works differently.
5. Programming Libraries i.e. pre-compiled routines be it source code, templates, data files,
etc(Cassandras,2014).
• The relationship between these three paradigms:
Object-oriented paradigm and event-driven paradigm can be used together and while in doing so the
OOPs concept is whole. The control flow moves from one object to another when a method is called.
EDP provides a graphical user interface which provides facility to write commands, OOP provides the
command in modules while PPP provides character user interface to write commands.
OOP becomes the synonym of data, PPP of procedures while EDP has events or selecting the user
interface as its synonym. OOP is related to procedural while EDP is related to both procedural and data
flow and PPP is related to structured and imperative flow.
9
mouse click, messages from other threads etc.
Web Applications based on JavaScript and GUI use it. What all it can do is- develop, build, debug, test,
deploy, version control, DevOps, Performance Improvement.
Visual Studio support languages such as C#, C++, C, JavaScript, Visual Basic. It also works well with
third party application such as Cordova and Unity. It helps you to install the workloads and thus making it
lightweight than ever thus the installation performance has become better.
Characteristics of Event-driven paradigm:
1. Time-driven i.e. the code runs on time trigger at a specific time.
2. Service-oriented i.e. programs are written based on the services that are requested by the users.
3. Pre-defined Functions i.e. already built function, so that the code will run as soon as it is called.
4. Modularity i.e. different modules to carry out different tasks and each module works differently.
5. Programming Libraries i.e. pre-compiled routines be it source code, templates, data files,
etc(Cassandras,2014).
• The relationship between these three paradigms:
Object-oriented paradigm and event-driven paradigm can be used together and while in doing so the
OOPs concept is whole. The control flow moves from one object to another when a method is called.
EDP provides a graphical user interface which provides facility to write commands, OOP provides the
command in modules while PPP provides character user interface to write commands.
OOP becomes the synonym of data, PPP of procedures while EDP has events or selecting the user
interface as its synonym. OOP is related to procedural while EDP is related to both procedural and data
flow and PPP is related to structured and imperative flow.
9
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

According to me, Python is associated with object-oriented paradigm as it is based on an object. All the
code is based on that object created.
It is totally based on object creation, so making and using classes and functi on is an easy task. The
important concepts of object-oriented paradigm i.e. encapsulation, inheritance, and polymorphism are
also considered in it. Classes are created at runtime and can also be modified after creation.
M2
To achieve merit common features that a developer has an access to IDE
IDE is cut short of Integrated Development Environment is an application that is used in application
development. The basic things that are there in an IDE are code editor, debugger, compiler, build
automation tool, class and object browser. It works as both standalone applications and as one or many
applications.
The IDEs not only helps in faster setup but also in faster development. Different Programming Languages
that the IDE supports are Python, PHP, C, C++, Java, JavaScript, Perl, HTML, etc. using an IDLE for
python is not its requirement but it makes the processing faster so every programmer prefers to use IDLE.
• IDLE
Integrated Development and Learning Environment or IDLE are for Python. PyCharm is the best-known
IDE for Python, it is interactive in nature. Other known IDLEs for Python are Python Command Line,
IPython, Spyder, Jupyter, etc.
Some of the known features for an IDLE are:
o It is coded completely in Python using Python GUI toolkit Tkinter.
o OS that supports it is Windows, MAC, UNIX.
o There are two windows in Python Shell- interpreter window and program window.
o The interpreter of the IDLE will tell you if there is any mistake in syntax by highlighting it.
o It also has a refractor option available in it.
10
code is based on that object created.
It is totally based on object creation, so making and using classes and functi on is an easy task. The
important concepts of object-oriented paradigm i.e. encapsulation, inheritance, and polymorphism are
also considered in it. Classes are created at runtime and can also be modified after creation.
M2
To achieve merit common features that a developer has an access to IDE
IDE is cut short of Integrated Development Environment is an application that is used in application
development. The basic things that are there in an IDE are code editor, debugger, compiler, build
automation tool, class and object browser. It works as both standalone applications and as one or many
applications.
The IDEs not only helps in faster setup but also in faster development. Different Programming Languages
that the IDE supports are Python, PHP, C, C++, Java, JavaScript, Perl, HTML, etc. using an IDLE for
python is not its requirement but it makes the processing faster so every programmer prefers to use IDLE.
• IDLE
Integrated Development and Learning Environment or IDLE are for Python. PyCharm is the best-known
IDE for Python, it is interactive in nature. Other known IDLEs for Python are Python Command Line,
IPython, Spyder, Jupyter, etc.
Some of the known features for an IDLE are:
o It is coded completely in Python using Python GUI toolkit Tkinter.
o OS that supports it is Windows, MAC, UNIX.
o There are two windows in Python Shell- interpreter window and program window.
o The interpreter of the IDLE will tell you if there is any mistake in syntax by highlighting it.
o It also has a refractor option available in it.
10

o It has a debugger which can view any namespace and breakpoints.
o There is this multi windows editor system in IDLE (be it the Shell window or the Editor window).
• Visual Studio 2017 IDE
Visual Studio is an IDE i.e., integrated development environment from Microsoft. It is being used to build
websites, mobile applications, and other computer programs. Perks of visual studio is that you can
develop anything that you want and it is supported by Windows, ioS, Android(Docs.microsoft, 2018).
Code editor and debugger are there in the Visual studio that also supports these many programming
languages.
Application for devices such as Azure, office, IOT, etc can also be developed using Visual Studios
(Sinha,2017).
11
o There is this multi windows editor system in IDLE (be it the Shell window or the Editor window).
• Visual Studio 2017 IDE
Visual Studio is an IDE i.e., integrated development environment from Microsoft. It is being used to build
websites, mobile applications, and other computer programs. Perks of visual studio is that you can
develop anything that you want and it is supported by Windows, ioS, Android(Docs.microsoft, 2018).
Code editor and debugger are there in the Visual studio that also supports these many programming
languages.
Application for devices such as Azure, office, IOT, etc can also be developed using Visual Studios
(Sinha,2017).
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 36
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.