Wednesday, August 5, 2020

Assessment item 2 - Interactive Drawing



Value: 15%
Due Date: 13-Sep-2020
Return Date: 07-Oct-2020
Submission method options: Alternative submission method
In this assignment you will use turtle graphics to create an interactive menu-based drawing application.
The application will initially show an empty drawing screen and present the user with the following main menu:
[L]ine
[A]rc
[T]ext
[S]ettings
[Q]uit

The user selects the menu command by entering the letter (case insensitive). The following prompts will depend on the selected option. For example, the following are the prompts for the Line command:
Line > x1 (default current x coordinate):
Line > y1 (default current y coordinate):
Line > x2:
Line > y2:

After the Line parameters are accepted, the program should draw a line on the drawing screen, store the current x and y coordinates, and return back to the main menu. Use the same approach for other commands.

The Arc command will accept two parameters: radius and angle. It will draw a partial circle with those parameters.

The Text command will accept four parameters: content, size, x and y coordinates. It will write the entered content on the screen with specified size at the specified coordinates.

The Settings command will show the following prompts:
Settings > Pen colour (default no change):
Settings > Pen thickness (default no change):
The entered values will apply to any future drawing commands.

Constraints
  1. You must create a module called easyshape.py that contains at least the following functions:
    • line(x1, y1, x2, y2)
    • text(content, size, x, y)
    • arc(radius, angle)
    • settings(colour, thickness)
  2. You must also use global variables for the colour and thickness values, as well as the current x and y coordinates.
  3. In your main program, you must import the module easyshape. You must not import any modules other than turtle and your own created modules. 

Your assignment should consist of following tasks.
Task 1
Draw a flowchart of your menu handling algorithm. You can abstract the defined functions using function symbols, but the main flowchart should provide sufficient level of details for the logic of your algorithm.
You can draw the flowcharts with a pen/pencil on a piece of 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
Select four sets of test data that will demonstrate the 'normal' operation of your program; that is, test data that will demonstrate what happens when a valid input is entered. Select three sets of test data that will demonstrate the 'abnormal' operation of your program. Please note that for this application, user input includes mouse clicks as well as keyboard button presses.
Set out test results in a tabular form as follows. It is important that the output listings (i.e., screenshots) are not edited in any way.

Test Data Table
Test data typeTest dataThe reason it was selectedThe output expected due to the use of the test dataThe screenshot of actual output when the test data is used
Normal    
Normal    
Normal




Normal




Abnormal    
Abnormal    
Abnormal





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 test data table above.
Your submission will consist of:
  1. Your algorithm through flowchart/s
  2. The table recording your chosen test data and results
  3. Source code for your Python implementation
Thus your directory for Assignment will at least contain two or three files (depending on whether you put the flowchart and the test table in the same file).

It is critically important that your test runs are unmodified outputs from your program, and that these results should be reproducible by the marker running your saved .py python program.

Rationale
This assessment task will work towards assessing the following learning outcome/s:
  • be able to analyse the steps involved in a disciplined approach to problem-solving, algorithm development and coding.
  • be able to demonstrate and explain elements of good programming style.
  • be able to identify, isolate and correct errors; and evaluate the corrections in all phases of the programming process.
  • be able to interpret and implement algorithms and program code.
  • be able to apply sound program analysis, design, coding, debugging, testing and documentation techniques to simple programming problems.
  • be able to write code in an appropriate coding language.

No comments:

Post a Comment

Python Files and Exceptions: Unit 9

  Table of contents Reading from a File Reading an Entire File File Paths Reading Line by Line Making a List of Lines from a File Working wi...