[Solved] CS160-Assignment 7 -Loops and Functions Using Turtle in Python

$25

File Name: CS160_Assignment_7__Loops_and_Functions_Using_Turtle_in_Python.zip
File Size: 584.04 KB

SKU: [Solved] CS160-Assignment 7 -Loops and Functions Using Turtle in Python Category: Tag:
5/5 - (1 vote)

Orientation:

You are half way through your first quarter at Oregon State University. Write a paragraph about the challenges you have faced that you were not expecting. Write another paragraph about anything really exciting and fun you have experienced in college that you were not expecting.

(80 pts) Computation:

In this assignment, you will design a computer program using sequential, conditional, looping, and functions. You are not allowed to use the built-in write() function in this assignment. You are going to learn to read Python documentation to create a graphical program using the turtle library. https://docs.python.org/3.7/library/turtle.html

Develop your program using Repl.it, and use your Lab #5 code as a template.

You will write a program that asks the user how many words they would like to generate to the screen. Your program will then present this number of words at random from a set of 4 words. One word must be your name (or your initials), but you can choose the other 3 words. You must make a function for each letter in your words and call a series of letter functions for the words you want to draw, and these words must be selected randomly for the number of words the user wants to see. You can have the turtle draw any variation of upper- and lower-case letters, and you can decide whether to clear the screen in between words drawn or present them all on the same canvas.

Requirement: Each letter must be in its own function, and the only global statements are the import turtle and random libraries and the main function call. Also, you need to handle all errors with the user not entering a positive integer for the number of words to see on the screen.

Other additional turtle functions youll need to write a word:

  • You can hide a turtle behind its invisibility cloak if you dont want it shown. It will still draw its lines if its pen is down, so make sure to use penup() and pendown(). The method is invoked as hideturtle(). To make the turtle visible again, use my_turtle.showturtle().

Begin by designing you program using these steps, and write steps 1, 2, and 4 on paper or in a text editor. Then, implement the program using Python.

  • Step 1: Problem Analysis. (10 pts)
    1. Comments about the problem to aid in understanding it.
    2. Description of the knowledge base (this list would include what you would be expected to know to follow the solution).
  • Step 2: Program Design. (20 pts) List the specific steps needed to get your turtle to draw your words to the screen in random order. Remember, you have to be very explicit here to make sure the computer can accomplish the task using your directions.

2.

.

  • Step 3: Program Implementation. (50 pts) This is the Python code that moves your turtle around the screen to draw the words. Download this .py file from Repl.it, but also copy and paste the share link from Repl.it, so we can run your code easily.
  • Step 4: Program Testing. There is not much to test for this program, other than entering a positive number for the number of words to see the turtle draw. Also, you would need to compare multiple runs to see if it is random or gives you the same series of words with each run of the program. Make sure you test for this, but you do not need to turn in anything for testing.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS160-Assignment 7 -Loops and Functions Using Turtle in Python[Solved] CS160-Assignment 7 -Loops and Functions Using Turtle in Python
$25