Search the whole station

计算概论代写 Python代写 Introduction to computing代写

CPSC111-Introduction to computing

计算概论代写 Assignment 2 – Python Practice: working with functions & Turtles  As always, all your answers should use functions and every function should

Assignment 2 – Python Practice: working with functions & Turtles 

As always, all your answers should use functions and every function should have a documentation string explaining the purpose of the function. Use the Python template given below at the top of your program you submit (don’t forget to modify it to include your information; your name and your student number.)

# Program: cpsc111-SP2020-asg2.py

# Author: Enter your Name and student number here

# Class: CPSC 111

# Section: Enter your section

# Date: Enter the starting date (for example June. 1 st, 2020)

# Task: Assignment #2

# Purpose: Solving _________________________________

#

Do not wait until the last minute to do this assignment in case you run into problems.

Submit your assignment to the instructor by email at: drahmalki@gmail.com

计算概论代写

Part 1 – Write simple functions [30 points, 10 pts each] 计算概论代写

Answer the following questions:

a) Write a Python function evaluateFunction() that takes one floating point number x as its argument and returns

The math module has a square root function and a logarithm function.

b) Using a while loop, write a Python function createListOfRandomFloatingPoints() that takes two floating point numbers start and end and returns the created list of 10 random floating-point values in the range of start to end inclusive. The random module has a random.uniform(start, end) function that returns a random floating-point number N such that start <= N <= end. Test your program using 19.95 and 99.95 as values entered for start and end.

c) Create a Python function dispalyTable() that takes the created list of random floatingpoint values and applies the function evaluateFunction() you wrote to each value in the list and print the results in normal and reverse orders as tables. There is a built-in function to reverse a list. You may not use it in this question.

计算概论代写

Part 2 – Turtle Graphics with repeating patterns [20 points; 10 pts each] 计算概论代写

1. Write a turtle graphics function that uses nested loops to draw 50 triangles forward and backward, to create the design shown below. Also, write the code that will demonstrate your function. Be sure to pay attention to proper indentation.

2. Write a turtle graphics function that uses a loop to draw 50 diamonds, to create the design shown below. Also, write the code that will demonstrate your function. Be sure to pay attention to proper indentation.

Happy computing! 计算概论代写

N.B: Next, you are going to make sure you can use the submission properly. This will be how you turn in your assignments electronically. The submission procedure only accepts zip files (NOT rar Files), so you are going to create a “Asg2_YourFirstName_YourStudentID.zip file containing all the programs you just wrote as well as this document with your name and student number added to it. To create a “.zip file, find the directory where the files are saved and select all of them. If you right-click on one of the selected files, you should have the option to create an archive by choosing “Send to” then “Compressed “zipped” Folder”.

Rename the created “.zip” file and give it the name Asg2_YourFirstName_YourStudentID.zip.

10 marks will be deducted if:

1. the email did not have a full name and a student # in the subject field or

2. the procedure for zipped file is not followed or

3. Python template and documentation are missing or

4. This document, with your names and student numbers on it, is not included with the zipped file or

5. Your partner’s email is not included in CC or BCc or

6. More than one submission has been made

A score of zero (0) will be given to everyone whose email is empty.

计算概论代写
计算概论代写

更多代写:CS澳大利亚网课代考  托福代考  英国Management 管理学  澳洲统计学论文代写  research代写 英国论文essays代写

合作平台:essay代写 论文代写 写手招聘 英国留学生代写

The prev: The next:

Related recommendations

1
您有新消息,点击联系!