This essay has been submitted by a student. This is not an example of the work written by professional essay writers.
Uncategorized

Programming Principles (Python)

This essay is written by:

Louis PHD Verified writer

Finished papers: 5822

4.75

Proficient in:

Psychology, English, Economics, Sociology, Management, and Nursing

You can get writing help to write an essay on these topics
100% plagiarism-free

Hire This Writer

Programming Principles (Python)

  • Introduction

The assignment entailed using the python Turtle library to draw an interactive forest simulation application. Turtle is a graphics library in python that allows drawing of images of the canvas(Vidal,2016). The application should allow the user to draw in different positions of the screen, either bird icons or tree icons. This is done when they choose the kind of image they want, e.g. bird and click at the position.

  • Prerequisites

The implementation of the project has prerequisites which must be met for it to work as expected.

One of them is a Python programming language installation. Python is easy to learn a high-level programming language(Srinath,2017). This can be found at Python official website at www.python.org.

You also need the Python Turtle module. These can be installed using the Python Package Manager called Pip or Pip3 for Python version 3. A package manager is a command that enables users to install and manage packages written by other programmers in a particular programming language(Muhammad et al.,2019). The Turtle Package can be installed with the command:

python3 -m pip install PythonTurtle

 

  • Design

The project was designed using a top-down approach. This involved decomposing the program into smaller, manageable functions and objects. The program was first divided into two classes to be implemented, Draw for drawing the tree and bird icons, and Forest, which finally achieved the forest simulation functionality. The classes were further decomposed into different methods and properties which carried out different feature. This made development easier since you could focus on one function at a time without worrying about other parts of the program(Goschnick,2018).

 

Different design techniques were also applied. Most outstanding of them was the use of flowcharts in the design of some of the functions that were employed in the program. A flowchart is a pictorial model of how program execution should start, proceed and end(Herrera-Camara,2017). The following is a flowchart for the handle_click() function that was implemented in the program.

 

 

 

  • Testing

Testing is essential in software development to eliminate errors and failures that could be caused by the program. It also assures users that the program is working as expected.

 

Several test cases were developed to test the program functionality.

Test Data Table
Test data

type

Test

data

The reason it

was selected

The output expected

due to the use of the

test data

The screenshot of actual

output when the test data is

used

NormalUser clicks inside boundary marginsTo show that either tree or bird icon is displayedEither tree or bird icon is displayed
NormalUser clicks on tree’s circleTo show that turtle changes to a treeClicking inside boundary displays tree icon.
NormalUser clicks on bird’s circleTo show that turtle changes to birdClicking inside boundary displays bird icon
NormalUser clicks left

arrow keyboard key when bird icon selected

To show that the angle of the turtle changesThe angle of turtle icon changes anti-clockwise
AbnormalUser clicks on “up” keyboard keyTo show that the

“up” keyboard key does not change application state

No action is undertaken.
AbnormalUser clicks on “b” keyboard keyTo show that the

“b” keyboard key does not change application state

No action is undertaken.
AbnormalUser clicks outside boundary marginsTo show that

clicking outside boundary margins does not initiate action

No action is undertaken.

 

 

  • Conclusion

The program was implemented successfully using the Python3 programming language. All the objectives were also met.

  • References

Vidal Duarte, E. (2016, July). Teaching the First Programming Course with Python’s Turtle Graphic Library. In Proceedings of the 2016 ACM Conference on Innovation and Technology in Computer Science Education (pp. 244-245).

 

Srinath, K. R. (2017). Python–The Fastest Growing Programming Language. International Research Journal of Engineering and Technology (IRJET), 4(12), 354-357.

 

Muhammad, H., Real, L. C. V., & Homer, M. (2019, October). Taxonomy of Package Management in Programming Languages and Operating Systems. In Proceedings of the 10th Workshop on Programming Languages and Operating Systems (pp. 60-66).

 

Goschnick, S. (2018). A Design Method for People-Oriented Programming.

 

Herrera-Camara, J. I., & Hammond, T. (2017, July). Flow2Code: from hand-drawn flowcharts to code execution. In Proceedings of the Symposium on Sketch-Based Interfaces and Modeling (pp. 1-13).

 

 

 

 

 

  Remember! This is just a sample.

Save time and get your custom paper from our expert writers

 Get started in just 3 minutes
 Sit back relax and leave the writing to us
 Sources and citations are provided
 100% Plagiarism free
error: Content is protected !!
×
Hi, my name is Jenn 👋

In case you can’t find a sample example, our professional writers are ready to help you with writing your own paper. All you need to do is fill out a short form and submit an order

Check Out the Form
Need Help?
Dont be shy to ask