In this assignment, your task is to create a simple line chart
program using Python turtle graphics. The data for line chart will
come from user input – it will be a sequence of integers in the
range [0, 20].
At the program start, you should set turtle animations to be
fastest, and make the turtle hidden. Next your program should
implement the following requirements.
To clearly understand the program requirements, watch this
demo video. You should aim for similar styles and colours.
Constraints
In your program, you can only import
the turtle library module.
In many online examples of turtle graphics applications,
multiple turtle objects are used on the same window. You are NOT
allowed to proceed that way. Use a single turtle for all
drawings.
You should follow good programming practices, for example using
named constants, creating several reusable functions (top-down
design) and minimizing the use of global variables.
Suggested dimensions
Window size: 500 × 500
Length of Axis: 400
Origin point: (–200, –200)
Sample Codes
All the turtle functions can be called after importing
the turtle module.
(1) To change the window size
(2) To write text
(3) To get a number input via dialog box
(4) To draw a square marker
(5) OPTIONAL - To disable turtle animations (instantaneous
drawing)
Above statement will cause all turtle drawings to be done in
batches of 5 steps. Sometimes it may cause a problem that a drawing
does not show up on screen when you expect. In those cases,
call turtle.update() to force draw all pending steps.
---
Your assignment should consist of the following tasks.
Task 1
Draw a high-level flowchart that represent
the algorithms of your program implementation. High-level flowchart
means it does not need to map exactly to your code or function
calls. The goal of such a flowchart is to illustrate the logic of
your algorithm without worrying about code intricacies.
You can hand-draw the flowchart with on paper and scan it for
submission, as long as the handwriting is clear and legible.
However, it is strongly recommended to draw flowcharts using a
drawing software.
Task 2
Perform black-box testing of your program and document it in
tabular form as follows. There should be at least six
(6) tests cases.
Task 3
Implement your program in Python. Comment on your code as
necessary to explain it clearly. Run your program using the
test data you have selected and complete the final column of the
table above.
In this assignment, your task is to create a simple line chart program using Python turtle graphics. The data for line c
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
In this assignment, your task is to create a simple line chart program using Python turtle graphics. The data for line c
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!