Essay Analysis

Question 1: survey
Complete the course survey so that we can get to know more about you. Time to complete – about 5 minutes.
If the link does not work then you can paste the following URL into a browser:
https://forms.office.com/Pages/ResponsePage.aspx?id=_oivH5ipW0yTySEKEdmlwpjJB6cP5-
NErPL8UxzRR65UMjRKSkRHT1M3RVFZMjRPWDVWTVlQS0ZYWi4u
Question 2: Tangential circles
You will add code to question_2.py. The output should look like this:
The spacing between the shapes is not important.
2 VERSION 1.1 27/01/2021
Some of the following functions from Python turtle library may be useful in solving this problem:
turtle.circle()
turtle.penup() or turtle.pu()
turtle.pendown() or turtle.pd()
turtle.setheading() or seth()
You may use other turtle functions if you wish.
Complete function move_to(position). This function is what’s known as a helper function. We can use it (and re-use it)
to do something useful towards the end goal. The parameter position is a pair of x, y values in parentheses describing the
position of the turtle on the canvas. T.
Complete function tangential_circles(total_circles) so that the function draws the number of circles
specified by the parameter total_circles. You will need to use one for loop. You should make use of the constants
START_RADIUS and RADIUS_INCREMENT. START_RADIUS is the radius of the first circle drawn. RADIUS_INCREMENT is the
amount in turtle steps that the radius increases with each circle. When you run the program, the shape on the left-hand
side will be drawn. You can remove the pass statement.
Add code to function main() to draw the shape on the right-hand side. Use functions move_to(position) and
tangential_circles(total_circles) again.
Question 3: Concentric circles
You will add code to question_3.py. The output should look like this:
Note: You will use the turtle functions in a slightly different way in this coursework. You must prefix all the
functions in the turtle library with the word ‘turtle’ like this:
turtle.fd(50)
turtle.lt(90)
In general, this is the correct way to use Python libraries. We’ll learn more about this as we go through the course.
3 VERSION 1.1 27/01/2021
You will need one for loop. You can use the move_to(position) function which you wrote for the previous function;
copy and paste it into question_3.py. Remove the pass statement. As before, make use of the constants START_RADIUS
and RADIUS_INCREMENT and use the turtle function turtle.circle().
Hint: before drawing the circles, move the turtle to position (0,0). You have probably noticed that the turtle walks
around the edge of the circle to draw it. For each circle, move the turtle to the edge of the circle and turn the turtle so
that it is facing north (straight up) or south (straight down).
Question 4: Ring of circles
You will add code to question_4.py. The output should look like this:
In this question the turtle draws no visible lines at all, the turtle’s pen colour is white so that its lines are invisible.
Take a look at the main() function, the function setup() is used for setting all the characteristics of the turtle
before anything else is done. setup() is complete, there is no need to add anything more to it (although you can if
you want).
You should start by completing function draw_inside_circle() which draws the orange circle in the middle. The
function should use the constants INSIDE_CIRCLE_RADIUS and INSIDE_CIRCLE_COLOR. To fill a shape with color you
should use the turtle functions: turtle.fillcolor(), turtle.begin_fill() and turtle.end_fill(). Take a
look at the Python documentation for examples.
Note: the centre of the circle should be at position (0, 0) but you have already seen that the turtle draws a circle
by walking around the outside of the circle. You need to move the turtle to the edge of the circle and turn it to
face either north or south before drawing the circle.
4 VERSION 1.1 27/01/2021
Finish function draw_ring_of_circles(num_circles, outer_circle_radius, pattern_radius).
The parameters are described in the table and diagram below.
Parameter Description
num_circles The number of circles in the ring.
outer_circle_radius The radius of the circles in the outer ring.
pattern_radius The distance from the centre of the inner circle to the tangent of the outer circle.
This is not a very good name for this parameter but we will leave the name
unchanged.
`
Note: you may change the value of the parameters in the main() function if you need to.
Question 5: (optional)
For a small amount of additional credit, create a file question_5.py and extend what you’ve done so far to create the
Ebbinghaus illusion.
outer_circle_radius
pattern_radius
5 VERSION 1.1 27/01/2021
Testing:
You are responsible for testing your program carefully. Make sure that you have thought about all the things that
can go wrong and test your program to ensure that you know it works correctly in all circumstances. Make sure that
you have tested your code on the CoCalc platform.
Submitting your assignment
At the submission link:
• Make sure your student number (not your name) is included in comments at the top of your program.
• Upload your program.
• You must ensure that your program works properly on the CoCalc platform.
Assessment
You are expected to show that you can code competently using the programming concepts covered so far in the course
including (but not limited to): use of variables, loops and functions.
Marking criteria will include:
• Correctness – your code must perform as specified
• You must apply the Python concepts appropriately.
• Programming style – see section ‘Style Guide’ for more detail.
• Your assignment will be marked using the rubric at the end of this document. This is the standard rubric used
in the Department of Computer Science. Marks for your project work will be awarded for the capabilities (i.e.
functional requirements) your system achieves, and the quality of the code.
Additional Challenges
• Additional marks may also be gained by taking on extra challenges but you should only attempt an additional
challenge if you have satisfied all requirements for the coursework.
• It’s up to you what you choose to do – if anything.
• Note: You are strongly encouraged to follow the specification carefully and to use programming techniques as
described in the course materials and textbooks. Poor quality code with additional functionality will not
improve your marks.

Plagiarism
Plagiarism will not be tolerated. Your code will be checked using a plagiarism detection tool.
Style Guide
You must adhere to the style guidelines in this section.
Formatting Style

  1. Use Python style conventions for your variable names (snake case: lowercase letters with words separated by
    underscores (_) to improve readability).
  2. Choose good names for your variables. For example, num_bright_spots is more helpful and readable
    than nbs.
    6 VERSION 1.1 27/01/2021
  3. Name constants properly using capital letters.
  4. Use a tab width of 4 or 8. The best way to make sure your program will be formatted correctly is never to mix
    spaces and tabs — use only tabs, or only spaces.
  5. Put a blank space before and after every operator. For example, the first line below is good but the second
    line is not:
    b = 3 > x and 4 – 5 < 32 b= 3>x and 4-5<32
  6. Each line must be less than 80 characters long including tabs and spaces. You should break up long lines
    using .
  7. Functions should be no longer than about 12 lines in length. Longer functions should be decomposed into 2
    or more smaller functions.
    Docstrings
    If you add your own functions you should comment them using docstrings. Take a look at the code you’ve been given
    for some examples. Your comments should:
  8. Describe precisely what the function does.
  9. Do not reveal how the function does it.
  10. Make the purpose of every parameter clear.
  11. Refer to every parameter by name.
  12. Be clear about whether the function returns a value, and if so, what.
  13. Explain any conditions that the function assumes are true. Examples: “n is an int”, “n != 0”, “the height and
    width of p are both even.”

This question has been answered.

Get Answer