COMP 1405 Assignment 1.2 Variables, Input, Calculations, Conditions, and Turtle solved

$35.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

Problem 1 of 2 (Guessing Game, 10 marks)
Marking Scheme: Refer to assignment submission page
Submission: Save your file as a1q1.py and add it to the zip submission.
Reading Ahead: 1 bonus mark for learning how to use a for loop to help accomplish the bottom question
It’s the guessing game! In Part 1, you wrote the pseudocode and flowchart for a simple
guessing game. Here, you’ll be making a modified version of that game in Python that asks
them for a max number, asks them for a number, and prints responses proportional to how far
off they were. It will ask 5 times before quitting. You can use copy-paste for multiple guesses
and the quit() function to end the program once they have guessed correctly.
Your program will ask the user for a maximum number to guess. It will then generate a random
number between one and the maximum guess and prompt the user for a guess. It should then
calculate the difference between the guess and the actual value – this should use the absolute
value, so no negatives. If the difference is over 50% of the maximum value, it should tell the
user “WAY TOO HIGH!” or “WAY TOO LOW!”. If it is under 10%, it should tell them “Slightly
high!” or “Slightly low!”, otherwise it should report “Too High” or “Too Low”.
The user should be prompted five times before giving up. When it ends, it should tell them what
the number actually was.
● To repeat the prompts, you do not need to use loops, you can just copy paste the code.
Try to put a comment over each one saying which guess it is.
● Topics you may want to explore:
○ Absolute values, when calculating the difference (Python link)
○ Python’s math module
○ Python’s random module
○ For Loop Bonus Marks: Chapters 4.4-4.7 (including the range function)
COMP 1405 C&D Fall 2020 Assignment 1.2 DUE: Tue. Oct. 6 @ 11:55PM EDT
Problem 2 of 2 (Drawing a Picture, 10 marks)
Marking Scheme: Refer to assignment submission page
Submission: Save your file as a1q2.py and add it to the zip submission.
Bonus: 1 bonus mark for modifying the picture using user input somehow
Reading Ahead: 1 bonus mark for learning how to using your own functions to help draw shapes
Reading Ahead: 1 bonus mark for using a loop to draw repeating patterns (stars, grass, etc.)
Now you’re going to use Turtle to draw a simple picture. It does not need to be a house! Draw
anything, be creative.
For full marks:
● You should only use turtle graphics (and math, if necessary)
● Use at least four different colours
● Include a background colour
● Use at least one circle
● Include at least four distinct shapes (rectangle, triangle, square, circle)
● No abstract art today; make sure it’s something recognizable
COMP 1405 C&D Fall 2020 Assignment 1.2 DUE: Tue. Oct. 6 @ 11:55PM EDT
Recap
Your zip file should contain your a1q1.py and a1q2.py, files.
Submit your assignment1.2.zip file to cuLearn.
Make sure you download the zip after submitting and verify the file contents.
Late submissions will receive a 2.5%/hour deduction up to an 8 hour cut-off period