Assignment 6. INF109 Dataprogrammering for naturvitskap

Size: px
Start display at page:

Download "Assignment 6. INF109 Dataprogrammering for naturvitskap"

Transcription

1 Assignment 6 INF109 Dataprogrammering for naturvitskap This is the sixth of seven assignments. You can get a total of 15 points for this task. Deadline is Friday, 15 April, Submit the report as a single.py file. Submit the report on the course website at MiSide. The tasks should be submitted individually, i.e. it should be your own work. However some cooperation and discussion is allowed. 1 Introduction In this task you are to make a game that draws a target at a random location on the screen and then the game times how long it takes the player to hit the target. There is to be a time penalty if the player misses the target. Finally, the game is to display two targets. One is the real target, and the other one is a false target. The player loses if she hits the false target. 2 Task 1 the game In this task you are to draw a target (a circle) at a random position in the window. The following code snippet sets x and y to random values between 1 and 10: >>> from random import randint >>> x = randint (1,10) >>> y = randint (1,10) Create a function random coordinate(x min, x max, y min, y max) that returns an (x, y)-coordinate where the x value is in (x, y) and the y value lies in [y min, y max]. This coordinate is used as the centre of a circle with a given radius r. Remember that when this function is called the (x, y) must be chosen so that the circle of radius r does not go outside the borders of the window. Warm up first by creating a program that creates a window of size which draws a red filled circle with a radius of 50 pixels at a random location in the window. The program ends when the user clicks on the circle (see the help function distance in Section 4). Then add the functionality to count the number of times the user misses, and then print this number out when the program ends. To obtain a red circle on a white background, use the following code snippet. (The function setfill fills the circle red, whilst the function setoutline draws a red edge.) See Figure 1 to see an example. Note that the object circ is of type Circle and must be created by giving the centre point and the radius, e.g. c = Circle(Point(150,250), 50). 1

2 win. setbackground (" white ") circ. setfill (" red ") circ. setoutline (" red ") Figure 1: A red circle with a radius of 50 pixels, drawn at location (150,250). 2.1 The first function You now create a program that draws a circle at a random location in the window and counts how many times the player misses the circle. This is now the first function. 1 Complete the following function. (Note that center is a Point and not a number.) def draw_and_count ( win, center, radius ): """ This function draws a red circle with center and radius as given in the given window and counts the amount of tries the user needs to hit inside it. Finally it undraws the circle and returns the number of misses the user made. """ misses = 0 # put your code here target. undraw () # undraws the target from window return misses This function should, as always, be tested. Check that everything works by creating a window, then calling this function with arguments of your choice and then check that the function returns 0 if you hit on the first attempt, and that in all other cases the function returns the number of times you missed (use print("user missed", draw and count(...),"times.")). 2.2 Timing Now you have completed the first part of the game. The next thing you should do is to make a stopwatch. You have the option in Python to obtain the current time. This enables you to measure the amount of time the user spends on completing a given task. After obtaining both 1 With the exception of the obvious help functions such as distance..., you also need the function that checks whether a point is inside an object is point inside. 2

3 the start and end times, you can compute the duration of the task as the difference between the two times, stop - start. In this task the player has ten seconds in which to be able to hit ten targets. This means that the program must time how long it takes from the beginning of the game until the player has hit the ten targets. To do this we use the package datetime. In this package there is an object with the same name, datetime, which we can use to obtain the time: >>> from datetime import datetime >>> print ( datetime. now ()) :01: >>> start = datetime. now () >>> stop = datetime. now () >>> print ( stop - start ) 0:00: >>> stop = datetime. now () >>> print ( stop - start ) 0:00: >>> delta = ( stop - start ) >>> delta datetime. timedelta (0, 24, ) >>> print ( delta. total_seconds ()) Note that delta is a strange object. It is a kind clock object that holds the information of a duration, i.e. a difference between two times. Remember that you can write help(delta) to display information about this object and about its functionality. Create the function as follows: def run_game_round ( win, n): """ This function draws a circle n times and for each time waits for the user to press inside the circle. Returns a pair containing the time used ( timedelta ) and the number of misses. """ misses = 0 start = datetime. now () # Put your code here, and remember to use draw_and_count! return ( delta, misses ) At the end of this task you can decide whether the player was successful at the game or not. The player gets a penalty in seconds for each unsuccessful shot. To win, a player must not have accumulated more than ten seconds in total (including the time penalty). 3 Task 2 a shrinking target Go back to the previous function you created, run game round and make the target smaller for each new round. You can do this easily by setting the size of the original target to be target_size = 50 and every time you draw it again, as i counts from 0 to n 1, reduce the radius of the circle. You can modify the function to reduce or increase the shrinking rate as you prefer (as long as there is some change in the radius). You can also randomize the radius for each new round by using randint. 3

4 radius = target_size - (5 * i) Below is a picture of the game where the player has managed to click correctly for a few targets, and the target has reduced in size significantly. Figure 2: Screenshot from the middle of a game. 4 Task 3 false target In this task, you are to modify draw and count. You are to create false targets that the player should not hit. The centre of the false target is to be called anti center, so you have to change the function to look like this: def draw_and_count ( win, center, anti_center, radius ): """... """ #... return misses If the player hits the false target then the player dies. The false target is to be drawn in a random place, just like the real target, and it should be the same size (radius). This means that it will shrink, just like the real target. This false target will be very slightly distinguishable from the real target, and this is to be achieved by drawing the false target with a colour that is a little bit darker than the colour of the real target. You can manually create any colour with (r, g, b)-values as follows: anti_target. setfill ( color_rgb (180,0,0) ) If the player hits the false target, the game terminates and the program prints that the player has lost. This leads to a small dilemma; how do you handle this when the function draw and count only returns the number of times that the player has missed? Here you will have to think of something clever that makes it easy for you. You can choose to return a negative number,none or other values which makes it possible for you to find out if the player hit the false target. 4

5 Figure 3: A game with a false target (on the left). In addition, you must be careful that the false target does not overlap with the real target. This is accomplished as follows: from math import pow, sqrt def def sq(x): """ Returns x^2, x squared """ return pow (x,2) distance (x1,x2,y1,y2): """ Returns distance from (x1,x2) to (y1,y2)""" return sqrt ( sq( x1 - x2) + sq( y1 - y2)) Use the distance function to ensure that the distance between the false target and the real target is at least (twice) the radius, and so make sure that the two targets never overlap. If the distance is not large enough, then you should obtain new random coordinates for the false target. (The distance function can also be used to check whether the player clicks inside a circle or not; the player s click is inside the circle only if the distance from the mouse click to the center is less than the radius - you can use Pythagoras theorem.) 5 Summary You are finished. Put all your functions in a function called main that does not take in any arguments. The main function will call the function run game round and create a window of the correct size, and set n = 10. 5

6 6 Submission Save your program in a.py file called oblig6-abc123.py, where abc123 should be replaced with your username and your assignment on the student portal Mi Side. Innleveringsmappe Vurderingsmappe Innlevering6. 7 Marking/assessment For this task, you can get a maximum of 15 points. The distribution of points is as follows. The program works as expected 12 (ca ) The program is well documented, clear, and with comments 2 Naming 1 15 The program works as expected. Here you will lose marks if your program prints the wrong data or in the wrong format (differs from the example), crashes in any manner, or if function names are not as stated. The program is well documented, clear, and with comments. You will lose marks if your program is not commented sufficiently, but also if there are too many comments. You can also lose marks if the program is unclear, meaning that it is difficult for another person to familiarize themselves with the program s functionality. Naming It is required that the names of variables and functions are sensibly chosen and that the naming used is consistent: either mixedcase or with underscore. 2 The tasks will be marked within one week of submission and the score and any comments will be posted in the assessment portfolio under comments. Questions and/or complaints on the marking can be directed to one of the group leaders. 2 mixedcase refers to variables such as innlestdata, and underscore refers to variables entered like innlest data. Choose one of these two and stick to that. Never start with a capital letter, e.g. InnlestData or similar, as these are reserved for class names, which are partially outside of the curriculum for this course. 6

Assignment 5. INF109 Dataprogrammering for naturvitskap

Assignment 5. INF109 Dataprogrammering for naturvitskap Assignment 5 INF109 Dataprogrammering for naturvitskap This is the fifth of seven assignments. You can get a total of 15 points for this task. Friday, 8. April, 23.59. Submit the report as a single.py

More information

Assignment 3. INF109 Dataprogrammering for naturvitskap

Assignment 3. INF109 Dataprogrammering for naturvitskap Assignment 3 INF109 Dataprogrammering for naturvitskap This is the third of seven assignments. You can get a total of 15 points for this task. Deadline is Friday, 4. march, 23.59. Submit the report as

More information

15-110: Principles of Computing, Spring 2018

15-110: Principles of Computing, Spring 2018 5-: Principles of Computing, Spring 28 Problem Set 8 (PS8) Due: Friday, March 3 by 2:3PM via Gradescope Hand-in HANDIN INSTRUCTIONS Download a copy of this PDF file. You have two ways to fill in your answers:.

More information

Exam 1 Format, Concepts, What you should be able to do, and Sample Problems

Exam 1 Format, Concepts, What you should be able to do, and Sample Problems CSSE 120 Introduction to Software Development Exam 1 Format, Concepts, What you should be able to do, and Sample Problems Page 1 of 6 Format: The exam will have two sections: Part 1: Paper-and-Pencil o

More information

Adobe Flash CS3 Reference Flash CS3 Application Window

Adobe Flash CS3 Reference Flash CS3 Application Window Adobe Flash CS3 Reference Flash CS3 Application Window When you load up Flash CS3 and choose to create a new Flash document, the application window should look something like the screenshot below. Layers

More information

Official Competition Manual March 2, 2005

Official Competition Manual March 2, 2005 Official Competition Manual March 2, 2005 Competition Instructions Logging In to the Competition Arena Log in to the competition arena using the handle and password that you chose during the competition

More information

? Answer:

? Answer: A1 What is the value of 1 2 + 2 3 + 3 4 + 4 5 5 2? A2 What is the value of k? 11 2 22 2 33 2 = 66 2 k. A3 The four-digit integers 5634 and 6435 share the following two properties: (i) they consist of four

More information

15-110: Principles of Computing, Spring Problem Set 3 (PS3) Due: Friday, February 9 by 2:30PM on Gradescope

15-110: Principles of Computing, Spring Problem Set 3 (PS3) Due: Friday, February 9 by 2:30PM on Gradescope 15-110: Principles of Computing, Spring 2018 Problem Set 3 (PS3) Due: Friday, February 9 by 2:30PM on Gradescope HANDIN INSTRUCTIONS Download a copy of this PDF file. You have two ways to fill in your

More information

[ the academy_of_code] Senior Beginners

[ the academy_of_code] Senior Beginners [ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell

More information

Patterns in Geometry. Polygons. Investigation 1 UNIT. Explore. Vocabulary. Think & Discuss

Patterns in Geometry. Polygons. Investigation 1 UNIT. Explore. Vocabulary. Think & Discuss UNIT K Patterns in Geometry In this lesson, you will work with two-dimensional geometric figures. You will classify polygons and find angle measures. Explore Inv 1 Polygons 172 How many squares are in

More information

Integers and Rational Numbers

Integers and Rational Numbers A A Family Letter: Integers Dear Family, The student will be learning about integers and how these numbers relate to the coordinate plane. The set of integers includes the set of whole numbers (0, 1,,,...)

More information

CPSC 217 Assignment 3

CPSC 217 Assignment 3 CPSC 217 Assignment 3 Due: Monday November 23, 2015 at 12:00 noon Weight: 7% Sample Solution Length: 135 lines, including some comments (not including the provided code) Individual Work: All assignments

More information

ST NICHOLAS COLLEGE RABAT MIDDLE SCHOOL HALF YEARLY EXAMINATIONS February 2016

ST NICHOLAS COLLEGE RABAT MIDDLE SCHOOL HALF YEARLY EXAMINATIONS February 2016 ST NICHOLAS COLLEGE RABAT MIDDLE SCHOOL HALF YEARLY EXAMINATIONS February 2016 Mark Level 5-8 Year 7 Information and Communication Technology TIME: 1h 30min Question 1 2 3 4 5 6 7 Global Mark Max. Mark

More information

CSC D84 Assignment 2 Game Trees and Mini-Max

CSC D84 Assignment 2 Game Trees and Mini-Max 0 The Cats Strike Back Due date: Wednesday, Feb. 21, 9am (electronic submission on Mathlab) This assignment can be completed individually, or by a team of 2 students This assignment is worth 10 units toward

More information

Lab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function

Lab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function Lab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function Due: Mar13 (Note that this is a 2-week lab) This lab must be done using paired partners. You should choose a different partner

More information

Decimals should be spoken digit by digit eg 0.34 is Zero (or nought) point three four (NOT thirty four).

Decimals should be spoken digit by digit eg 0.34 is Zero (or nought) point three four (NOT thirty four). Numeracy Essentials Section 1 Number Skills Reading and writing numbers All numbers should be written correctly. Most pupils are able to read, write and say numbers up to a thousand, but often have difficulty

More information

mith College Computer Science Lecture Notes CSC111 Week 7 Spring 2018 Dominique Thiébaut

mith College Computer Science Lecture Notes CSC111 Week 7 Spring 2018 Dominique Thiébaut mith College Computer Science Lecture Notes Week 7 Spring 2018 CSC111 Dominique Thiébaut dthiebaut@smith.edu Midterm Grades available later today (3/19/18) Outline A Second Look at Files Reading Files

More information

Lab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function

Lab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function Lab 2: Booleans, Strings, Random Numbers, Recursion, Variables, Input function Due: Mar25 (Note that this is a 2-week lab) This lab must be done using paired partners. You should choose a different partner

More information

CMSC 201 Spring 2018 Project 3 Minesweeper

CMSC 201 Spring 2018 Project 3 Minesweeper CMSC 201 Spring 2018 Project 3 Minesweeper Assignment: Project 3 Minesweeper Due Date: Design Document: Friday, May 4th, 2018 by 8:59:59 PM Project: Friday, May 11th, 2018 by 8:59:59 PM Value: 80 points

More information

Math 144 Activity #2 Right Triangle Trig and the Unit Circle

Math 144 Activity #2 Right Triangle Trig and the Unit Circle 1 p 1 Right Triangle Trigonometry Math 1 Activity #2 Right Triangle Trig and the Unit Circle We use right triangles to study trigonometry. In right triangles, we have found many relationships between the

More information

Assignment 3 Functions, Graphics, and Decomposition

Assignment 3 Functions, Graphics, and Decomposition Eric Roberts Handout #19 CS106A October 8, 1999 Assignment 3 Functions, Graphics, and Decomposition Due: Friday, October 15 [In] making a quilt, you have to choose your combination carefully. The right

More information

CMSC 201 Spring 2018 Project 2 Battleship

CMSC 201 Spring 2018 Project 2 Battleship CMSC 201 Spring 2018 Project 2 Battleship Assignment: Project 2 Battleship Due Date: Design Document: Friday, April 13th, 2018 by 8:59:59 PM Project: Friday, April 20th, 2018 by 8:59:59 PM Value: 80 points

More information

Draw beautiful and intricate patterns with Python Turtle, while learning how to code with Python.

Draw beautiful and intricate patterns with Python Turtle, while learning how to code with Python. Raspberry Pi Learning Resources Turtle Snowflakes Draw beautiful and intricate patterns with Python Turtle, while learning how to code with Python. How to draw with Python Turtle 1. To begin, you will

More information

Measurement Unit. This booklet belongs to:

Measurement Unit. This booklet belongs to: Measurement Unit This booklet belongs to: LESSON # DATE QUESTIONS FROM NOTES 1 2 3 4 5 6 7 8 Questions to review This booklet is homework and will be collected on the test day. Your teacher has important

More information

Here is a sample IDLE window illustrating the use of these two functions:

Here is a sample IDLE window illustrating the use of these two functions: 1 A SLIGHT DETOUR: RANDOM WALKS One way you can do interesting things with a program is to introduce some randomness into the mix. Python, and most programming languages, typically provide a library for

More information

CMPSCI 187 / Spring 2015 Hangman

CMPSCI 187 / Spring 2015 Hangman CMPSCI 187 / Spring 2015 Hangman Due on February 12, 2015, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 CMPSCI 187 / Spring 2015 Hangman Contents Overview

More information

Table of Contents. Student Practice Pages. Number Lines and Operations Numbers. Inverse Operations and Checking Answers... 40

Table of Contents. Student Practice Pages. Number Lines and Operations Numbers. Inverse Operations and Checking Answers... 40 Table of Contents Introduction... Division by Tens... 38 Common Core State Standards Correlation... Division of -Digit Numbers... 39 Student Practice Pages Number Lines and Operations Numbers Inverse Operations

More information

Major Assignment: Pacman Game

Major Assignment: Pacman Game Major Assignment: Pacman Game 300580 Programming Fundamentals Week 10 Assignment The major assignment involves producing a Pacman style game with Clara using the Greenfoot files that are given to you.

More information

Green Globs And Graphing Equations

Green Globs And Graphing Equations Green Globs And Graphing Equations Green Globs and Graphing Equations has four parts to it which serve as a tool, a review or testing device, and two games. The menu choices are: Equation Plotter which

More information

Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018

Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018 Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018 Due: Tuesday, September 18, 11:59 pm Collaboration Policy: Level 1 (review full policy for details) Group Policy: Individual This lab will give you experience

More information

1 Some easy lines (2, 17) (10, 17) (18, 2) (18, 14) (1, 5) (8, 12) Check with a ruler. Are your lines straight?

1 Some easy lines (2, 17) (10, 17) (18, 2) (18, 14) (1, 5) (8, 12) Check with a ruler. Are your lines straight? 1 Some easy lines Computers draw images using pixels. Pixels are the tiny squares that make up the image you see on computer monitors. If you look carefully at a computer screen with a magnifying glass,

More information

Classification of Surfaces

Classification of Surfaces Classification of Surfaces 16 April 2014 Classification of Surfaces 16 April 2014 1/29 Last Time On Monday we saw some examples of surfaces and how we can build some by starting with a rectangle and gluing

More information

Computer and Programming: Lab 1

Computer and Programming: Lab 1 01204111 Computer and Programming: Lab 1 Name ID Section Goals To get familiar with Wing IDE and learn common mistakes with programming in Python To practice using Python interactively through Python Shell

More information

Animations involving numbers

Animations involving numbers 136 Chapter 8 Animations involving numbers 8.1 Model and view The examples of Chapter 6 all compute the next picture in the animation from the previous picture. This turns out to be a rather restrictive

More information

Basic Computer Programming (Processing)

Basic Computer Programming (Processing) Contents 1. Basic Concepts (Page 2) 2. Processing (Page 2) 3. Statements and Comments (Page 6) 4. Variables (Page 7) 5. Setup and Draw (Page 8) 6. Data Types (Page 9) 7. Mouse Function (Page 10) 8. Keyboard

More information

Tips for Effective Online Office Hours

Tips for Effective Online Office Hours Tips for Effective Online Office Hours The following is a series of tips for conducting effective online office hours using Adobe Connect. When done right, it is an exciting and dynamic way to involve

More information

DSA-QAG NMH - Audit Portal Guidance

DSA-QAG NMH - Audit Portal Guidance DSA-QAG NMH - Audit Portal Guidance Date: 11 January 2017 Version: 1.0 Document Management Revision History Version Date Changes page 2 of 12 Table of Contents 1 INTRODUCTION... 4 1.1 DSA-QAG... 4 1.2

More information

6.S189 Homework 2. What to turn in. Exercise 3.1 Defining A Function. Exercise 3.2 Math Module.

6.S189 Homework 2. What to turn in. Exercise 3.1 Defining A Function. Exercise 3.2 Math Module. 6.S189 Homework 2 http://web.mit.edu/6.s189/www/materials.html What to turn in Checkoffs 3, 4 and 5 are due by 5 PM on Monday, January 15th. Checkoff 3 is over Exercises 3.1-3.2, Checkoff 4 is over Exercises

More information

Tutor Handbook for WebCT

Tutor Handbook for WebCT Tutor Handbook for WebCT Contents Introduction...4 Getting started...5 Getting a course set up...5 Logging onto WebCT...5 The Homepage...6 Formatting and designing the Homepage...8 Changing text on the

More information

Chapter 1. Data types. Data types. In this chapter you will: learn about data types. learn about tuples, lists and dictionaries

Chapter 1. Data types. Data types. In this chapter you will: learn about data types. learn about tuples, lists and dictionaries Chapter 1 Data types In this chapter you will: learn about data types learn about tuples, lists and dictionaries make a magic card trick app. Data types In Python Basics you were introduced to strings

More information

Integers and the Coordinate Plane

Integers and the Coordinate Plane Name Date Class 9A Dear Family, A Family Letter: Understanding Integers The student will begin the study of an important set of numbers called integers. Integers are the set of numbers that include all

More information

Self-Teach Exercises: Getting Started Turtle Python

Self-Teach Exercises: Getting Started Turtle Python Self-Teach Exercises: Getting Started Turtle Python 0.1 Select Simple drawing with pauses Click on the Help menu, point to Examples 1 drawing, counting, and procedures, and select the first program on

More information

15-110: Principles of Computing, Spring 2018

15-110: Principles of Computing, Spring 2018 15-110: Principles of Computing, Spring 2018 Problem Set 5 (PS5) Due: Friday, February 23 by 2:30PM via Gradescope Hand-in HANDIN INSTRUCTIONS Download a copy of this PDF file. You have two ways to fill

More information

CIT 590 Homework 10 Battleship

CIT 590 Homework 10 Battleship CIT 590 Homework 10 Battleship Purposes of this assignment: To give you more experience with classes and inheritance General Idea of the Assignment Once again, this assignment is based on a game, since

More information

Best Student Exam (Open and Closed) Solutions Texas A&M High School Math Contest 8 November 2014

Best Student Exam (Open and Closed) Solutions Texas A&M High School Math Contest 8 November 2014 Best Student Exam (Open and Closed) Solutions Texas A&M High School Math Contest 8 November 2014 1. The numbers 1, 2, 3, etc. are written down one after the other up to 1000, without any commas, in one

More information

Erasmus+ Project: Yestermorrow Year 1 Maths: Pythagorean Theorem

Erasmus+ Project: Yestermorrow Year 1 Maths: Pythagorean Theorem Erasmus+ Project: Yestermorrow Year 1 Maths: Pythagorean Theorem Workshop (Coding Android Mobile Apps): Collision Detection and the Pythagorean Theorem (Based on the code.org worksheet) WORKSHOP OVERVIEW

More information

Spring CS Homework 3 p. 1. CS Homework 3

Spring CS Homework 3 p. 1. CS Homework 3 Spring 2018 - CS 111 - Homework 3 p. 1 Deadline 11:59 pm on Friday, February 9, 2018 Purpose CS 111 - Homework 3 To try out another testing function, check-within, to get more practice using the design

More information

2.6 Graphics SIMPLE DRAWINGS 9/9/16 74

2.6 Graphics SIMPLE DRAWINGS 9/9/16 74 2.6 Graphics SIMPLE DRAWINGS 9/9/16 74 Drawing Simple Graphics To help you create simple drawings, we have included a graphics module with the book that is a simplified version of Python s more complex

More information

2. Getting Started When you start GeoGebra, you will see a version of the following window. 1

2. Getting Started When you start GeoGebra, you will see a version of the following window. 1 Math 5335 Fall 2018 Lab #0: Installing and using GeoGebra This semester you will have a number of lab assignments which require you to use GeoGebra, a dynamic geometry program. GeoGebra lets you explore

More information

Partitioning a disk prior to Linux Installation

Partitioning a disk prior to Linux Installation Partitioning a disk prior to Linux Installation by Andy Pepperdine This paper will describe how to partition a disk how you want it before you install Linux. The partitioning process may be initiated either

More information

Lesson 18: Animation. Computer Programming is Fun!

Lesson 18: Animation. Computer Programming is Fun! Lesson 18: Animation So how do you make your drawings move and change? That's what this section is about. I'd like to introduce you to your new friend, Mr. Timer. A timer gives you the ability to tell

More information

ASSIGNMENT 2. COMP-202A, Fall 2013, All Sections. Due: October 20 th, 2013 (23:59)

ASSIGNMENT 2. COMP-202A, Fall 2013, All Sections. Due: October 20 th, 2013 (23:59) ASSIGNMENT 2 COMP-202A, Fall 2013, All Sections Due: October 20 th, 2013 (23:59) Please read the entire PDF before starting. You must do this assignment individually and, unless otherwise specified, you

More information

Use the Associative Property of Multiplication to find the product.

Use the Associative Property of Multiplication to find the product. 3-1 1. The Associative Property of Multiplication states factors can be grouped differently and the product remains the same. Changing the grouping of the factors changes the factors that are multiplied

More information

Student Mathematician: Date: Some, All or None Tell whether each statement below is true or false by circling the correct answer. If the statement is false, give a counterexample using words and/or pictures.

More information

Curves & Splines. Assignment #3. Overview & Objectives. Due Dates. CPSC 453 Fall 2018 University of Calgary

Curves & Splines. Assignment #3. Overview & Objectives. Due Dates. CPSC 453 Fall 2018 University of Calgary Curves & Splines Assignment #3 CPSC 453 Fall 2018 University of Calgary Overview & Objectives The main objective of this third assignment in CPSC 453 is to learn to work with Bézier curves and splines.

More information

HOW TO. In this section, you will find. miscellaneous handouts that explain. HOW TO do various things.

HOW TO. In this section, you will find. miscellaneous handouts that explain. HOW TO do various things. In this section, you will find miscellaneous handouts that explain do various things. 140 SAVING Introduction Every time you do something, you should save it on the DESKTOP. Click Save and then click on

More information

Basics of Programming with Python

Basics of Programming with Python Basics of Programming with Python A gentle guide to writing simple programs Robert Montante 1 Topics Part 3 Obtaining Python Interactive use Variables Programs in files Data types Decision-making Functions

More information

Use the Move tool to drag A around and see how the automatically constructed objects (like G or the perpendicular and parallel lines) are updated.

Use the Move tool to drag A around and see how the automatically constructed objects (like G or the perpendicular and parallel lines) are updated. Math 5335 Fall 2015 Lab #0: Installing and using GeoGebra This semester you will have a number of lab assignments which require you to use GeoGebra, a dynamic geometry program. GeoGebra lets you explore

More information

A Bullseye. Problem. Output. For each dataset, print a line of the form: SCORE: N to M, PLAYER P WINS. Or: SCORE: N to M, TIE.

A Bullseye. Problem. Output. For each dataset, print a line of the form: SCORE: N to M, PLAYER P WINS. Or: SCORE: N to M, TIE. A Bullseye A simple dartboard consists of a flat, circular piece of cork with concentric rings drawn on it. Darts are thrown at the board by players in an attempt to hit the center of the dartboard (the

More information

Resize and Watermark Images Using Ribbet.com

Resize and Watermark Images Using Ribbet.com Resize and Watermark Images Using Ribbet.com Ribbet.com provides an easy, free service for simple image editing. Ribbet.com is capable of making many different changes to your image, but we focus on re-sizing

More information

THE REAL NUMBER SYSTEM

THE REAL NUMBER SYSTEM THE REAL NUMBER SYSTEM Review The real number system is a system that has been developing since the beginning of time. By now you should be very familiar with the following number sets : Natural or counting

More information

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete Scan Conversion CMP 477 Computer Graphics S. A. Areete What is Scan-Conversion? 2D or 3D objects in real world space are made up of graphic primitives such as points, lines, circles and filled polygons.

More information

1. One-third of 105 is the same as seven-sixths of what number? 1.

1. One-third of 105 is the same as seven-sixths of what number? 1. Blitz, Page. One-third of 05 is the same as seven-sixths of what number?. 2. A rectangle has length 6 and width 2. What is the radius of the 2. units circle that passes through the four vertices of the

More information

mith College Computer Science CSC111 Week 8 Spring 2018 Dominique Thiébaut

mith College Computer Science CSC111 Week 8 Spring 2018 Dominique Thiébaut mith College Computer Science CSC111 Week 8 Spring 2018 Dominique Thiébaut dthiebaut@smith.edu mith Hac Smith Hack Smi k Smith Hack Smith Ha ack Smith Hack Smith Hack Smit ack Smith Hack Smith Hack Smith

More information

Functional Programming in Haskell for A level teachers

Functional Programming in Haskell for A level teachers Functional Programming in Haskell for A level teachers About this document Functional Programming is now part of the A level curriculum. This document is intended to get those who already have some programming

More information

Problem Set 6: Word Game II Handed out: Saturday, June 17th, DUE: 11:59pm Friday June 22th, 2016

Problem Set 6: Word Game II Handed out: Saturday, June 17th, DUE: 11:59pm Friday June 22th, 2016 Problem Set 6: Word Game II Handed out: Saturday, June 17th, 2016. DUE: 11:59pm Friday June 22th, 2016 Introduction In this problem set you will write a program that will play the word game all by itself.

More information

In this lesson you will learn: How to capture the input from the user. How to write programs using variables and lists. Athletics Swimming Gymnastics

In this lesson you will learn: How to capture the input from the user. How to write programs using variables and lists. Athletics Swimming Gymnastics Lesson 4 A m In this lesson you will learn: How to capture the input from the user. How to write programs using variables and lists. Advanced Scratch Sports Day Jyoti and Tejas are planning to create a

More information

Unit 1, Lesson 1: Moving in the Plane

Unit 1, Lesson 1: Moving in the Plane Unit 1, Lesson 1: Moving in the Plane Let s describe ways figures can move in the plane. 1.1: Which One Doesn t Belong: Diagrams Which one doesn t belong? 1.2: Triangle Square Dance m.openup.org/1/8-1-1-2

More information

3.7. Vertex and tangent

3.7. Vertex and tangent 3.7. Vertex and tangent Example 1. At the right we have drawn the graph of the cubic polynomial f(x) = x 2 (3 x). Notice how the structure of the graph matches the form of the algebraic expression. The

More information

Functions and Graphs. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996.

Functions and Graphs. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996. Functions and Graphs The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996. Launch Mathematica. Type

More information

A B C 1 Number of Squares Number of Nickels Total Number of Nickels =A2+1 =B2*2 =B3+C2

A B C 1 Number of Squares Number of Nickels Total Number of Nickels =A2+1 =B2*2 =B3+C2 6.7 Geometric Series The Canadian Open is an outdoor tennis tournament. The tournament started in 1881, and the men s and women s events alternate between Toronto and Montreal every other year. In the

More information

Use Parametric notation. Interpret the effect that T has on the graph as motion.

Use Parametric notation. Interpret the effect that T has on the graph as motion. Learning Objectives Parametric Functions Lesson 3: Go Speed Racer! Level: Algebra 2 Time required: 90 minutes One of the main ideas of the previous lesson is that the control variable t does not appear

More information

Street Artist Teacher support materials Hour of Code 2017

Street Artist Teacher support materials Hour of Code 2017 Street Artist Street Artist Teacher support materials Hour of Code 07 Kano Hour of Code Street Artist Kano Hour of Code Challenge : Warmup What the ll make A random circle drawer that fills the screen

More information

The x coordinate tells you how far left or right from center the point is. The y coordinate tells you how far up or down from center the point is.

The x coordinate tells you how far left or right from center the point is. The y coordinate tells you how far up or down from center the point is. We will review the Cartesian plane and some familiar formulas. College algebra Graphs 1: The Rectangular Coordinate System, Graphs of Equations, Distance and Midpoint Formulas, Equations of Circles Section

More information

Tips and Tricks for Microsoft PowerPoint Game

Tips and Tricks for Microsoft PowerPoint Game Tips and Tricks for Microsoft PowerPoint Game Topics include: 1. Linking 2. Inserting Sound 3. Animation 4. Background Ideas 5. Buttons and Image Linking 6. Creating an Invisible Hot Spot 7. Set as One

More information

Subject : Mathematics Level B1 Class VII Lesson: 1 (Integers)

Subject : Mathematics Level B1 Class VII Lesson: 1 (Integers) Subject : Mathematics Level B1 Class VII Lesson: 1 (Integers) Skill/Competency /Concept Computational Skill Properties of Addition and subtraction of integers Multiplication and division Operation on integer.

More information

15-110: Principles of Computing, Spring 2018

15-110: Principles of Computing, Spring 2018 15-110: Principles of Computing, Spring 2018 Programming Assignment 11 (PA11) Due: Tuesday, May 1 by 9PM IMPORTANT ANNOUNCEMENT You cant drop this assignment even if it is your lowest PA score. Failure

More information

PLAR e-portfolio Instructions. This is easier and faster than it looks! To create your e-portfolio, you will need to move through the following steps.

PLAR e-portfolio Instructions. This is easier and faster than it looks! To create your e-portfolio, you will need to move through the following steps. PLAR e-portfolio Instructions This is easier and faster than it looks! To create your e-portfolio, you will need to move through the following steps. First, here is a big picture overview of what you are

More information

Have the students look at the editor on their computers. Refer to overhead projector as necessary.

Have the students look at the editor on their computers. Refer to overhead projector as necessary. Intro to Programming (Time 15 minutes) Open the programming tool of your choice: If you ve installed, DrRacket, double-click the application to launch it. If you are using the online-tool, click here to

More information

Photoshop Tutorial: Basic Selections

Photoshop Tutorial: Basic Selections Photoshop Tutorial: Basic Selections Written by Steve Patterson, Edited by Mr. Nickel In this Photoshop tutorial, we're going to look at how to get the most out of Photoshop's basic selection tools, such

More information

Math Circle Beginners Group January 17, 2016 Geometry II

Math Circle Beginners Group January 17, 2016 Geometry II Math Circle Beginners Group January 17, 2016 Geometry II Warm-up Problem 1. How many equilateral triangles can you make using six identical line segments? You can make eight equilateral triangles with

More information

Math-in-CTE Lesson Plan Template

Math-in-CTE Lesson Plan Template Lesson Development Math-in-CTE Lesson Plan Template Lesson Title: Basic Geometric Concepts Lesson # Author(s): Phone Number(s): E-mail Address(es): Juan Carlos Martínez jcmartinez@dadeschoolsnet Bergman

More information

COMP : Practical 6 Buttons and First Script Instructions

COMP : Practical 6 Buttons and First Script Instructions COMP126-2006: Practical 6 Buttons and First Script Instructions In Flash, we are able to create movies. However, the Flash idea of movie is not quite the usual one. A normal movie is (technically) a series

More information

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website: Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website: https://users.wpi.edu/~sjarvis/ece2049_smj/ We will come around checking your pre-labs

More information

Problem 1.1 (3 pts) :Python uses atomic data types and builds up from there. Give an example of: a. an int b. a double c. a string

Problem 1.1 (3 pts) :Python uses atomic data types and builds up from there. Give an example of: a. an int b. a double c. a string Lab 1: Due Sunday, Feb 28, midnight This is a paired programming lab: In this lab you will work in pairs. In lab, you will choose your partner for the next two weeks. Get your partner s name and email

More information

DRAFT CHAPTER. Surface Area GET READY. xxx. Math Link. 5.1 Warm Up xxx. 5.1 Views of Three-Dimensional Objects xxx. 5.

DRAFT CHAPTER. Surface Area GET READY. xxx. Math Link. 5.1 Warm Up xxx. 5.1 Views of Three-Dimensional Objects xxx. 5. CHAPTER 5 Surface Area GET READY Math Link xxx xxx 5.1 Warm Up xxx 5.1 Views of Three-Dimensional Objects xxx 5.2 Warm Up xxx 5.2 Nets of Three-Dimensional Objects xxx 5.3 Warm Up xxx 5.3 Surface Area

More information

Programming Languages

Programming Languages Programming Languages Week 9 Exercises Object-oriented programming in Python (2) Objects are especially useful for factoring state and behaviour. When two (or more) different classes of object are specicialisations

More information

int a; int b = 3; for (a = 0; a < 8 b < 20; a++) {a = a + b; b = b + a;}

int a; int b = 3; for (a = 0; a < 8 b < 20; a++) {a = a + b; b = b + a;} 1. What does mystery(3) return? public int mystery (int n) { int m = 0; while (n > 1) {if (n % 2 == 0) n = n / 2; else n = 3 * n + 1; m = m + 1;} return m; } (a) 0 (b) 1 (c) 6 (d) (*) 7 (e) 8 2. What are

More information

EEN118 LAB FOUR. h = v t ½ g t 2

EEN118 LAB FOUR. h = v t ½ g t 2 EEN118 LAB FOUR In this lab you will be performing a simulation of a physical system, shooting a projectile from a cannon and working out where it will land. Although this is not a very complicated physical

More information

Grades 7 & 8, Math Circles 31 October/1/2 November, Graph Theory

Grades 7 & 8, Math Circles 31 October/1/2 November, Graph Theory Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grades 7 & 8, Math Circles 31 October/1/2 November, 2017 Graph Theory Introduction Graph Theory is the

More information

Making ecards Can Be Fun!

Making ecards Can Be Fun! Making ecards Can Be Fun! A Macromedia Flash Tutorial By Mike Travis For ETEC 664 University of Hawaii Graduate Program in Educational Technology April 4, 2005 The Goal The goal of this project is to create

More information

Drawing a Circle. 78 Chapter 5. geometry.pyde. def setup(): size(600,600) def draw(): ellipse(200,100,20,20) Listing 5-1: Drawing a circle

Drawing a Circle. 78 Chapter 5. geometry.pyde. def setup(): size(600,600) def draw(): ellipse(200,100,20,20) Listing 5-1: Drawing a circle 5 Transforming Shapes with Geometry In the teahouse one day Nasrudin announced he was selling his house. When the other patrons asked him to describe it, he brought out a brick. It s just a collection

More information

Math Day 2 Programming: How to make computers do math for you

Math Day 2 Programming: How to make computers do math for you Math Day 2 Programming: How to make computers do math for you Matt Coles February 10, 2015 1 Intro to Python (15min) Python is an example of a programming language. There are many programming languages.

More information

Exam 2 Review. 2. What the difference is between an equation and an expression?

Exam 2 Review. 2. What the difference is between an equation and an expression? Exam 2 Review Chapter 1 Section1 Do You Know: 1. What does it mean to solve an equation? 2. What the difference is between an equation and an expression? 3. How to tell if an equation is linear? 4. How

More information

PURPLE COMET MATH MEET April 2011 HIGH SCHOOL - PROBLEMS. The ratio of 3 to the positive number n is the same as the ratio of n to 192. Find n.

PURPLE COMET MATH MEET April 2011 HIGH SCHOOL - PROBLEMS. The ratio of 3 to the positive number n is the same as the ratio of n to 192. Find n. PURPLE COMET MATH MEET April 2011 HIGH SCHOOL - PROBLEMS Copyright Titu Andreescu and Jonathan Kane Problem 1 The ratio of 3 to the positive number n is the same as the ratio of n to 192. Find n. Problem

More information

Reminders. Lecture Outline. Lecture Agenda. Namespaces II. Namespaces I. COMP10001 Foundations of Computing PEP8, Modules and Files

Reminders. Lecture Outline. Lecture Agenda. Namespaces II. Namespaces I. COMP10001 Foundations of Computing PEP8, Modules and Files COMP10001 Foundations of Computing PEP8, Modules and Files Reminders Semester 1, 2017 Tim Baldwin & Egemen Tanin Grok Worksheets 8 11 due at the end of this week Have a go at the early-release tutesheet

More information

CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point?

CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point? CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point? Overview For this lab, you will use: one or more of the conditional statements explained below scanf()

More information

3. Mr. White does not wear white, so he is wearing the blue shirt. 4. Then Mr. Red wears a white shirt.

3. Mr. White does not wear white, so he is wearing the blue shirt. 4. Then Mr. Red wears a white shirt. 5A METHOD 1: Strategy: Use reasoning. 1. Mr. Red and Mr. White are older than the man in gray. Neither Mr. Red nor Mr. White wears gray. Mr. Gray does not wear gray. So Mr. Blue wears the gray shirt. 2.

More information

Susan had $50 to spend at the carnival. She spent $12 on food and twice as much on rides. How many dollars did she have left to spend?

Susan had $50 to spend at the carnival. She spent $12 on food and twice as much on rides. How many dollars did she have left to spend? Susan had $50 to spend at the carnival. She spent $12 on food and twice as much on rides. How many dollars did she have left to spend? (A) 12 (B) 14 (C) 26 (D) 38 (E) 50 2008 AMC 8, Problem #1 Susan spent

More information

Working with Transformations on the Coordinate Plane

Working with Transformations on the Coordinate Plane Working with Transformations on the Coordinate Plane Movies create the illusion of movement by showing us 24 images per second. When the human eye processes 24 images per second it is interpreted in our

More information