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

Size: px
Start display at page:

Download "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"

Transcription

1 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 address. Most likely you will not complete this lab during the allotted lab time and will need to meet with your partner outside of lab. While working on this lab, one person should work the computer and the other person should navigate, or coach the computer operator. Every 20 minutes the two partners should switch who is working the computer and who is coaching. When you turn in the lab, you should only turn in one lab per set of partners, but the lab must have both students names on it. This means you, person who isn t submitting the lab! Make sure your name is on the lab as well as the person doing the submitting. You should submit your lab via Sakai. In addition, both partners should turn in a separate peer-review form giving feedback on your partner s participation in the lab. Peer Reviews can be downloaded from my Web site and should also be submitted through Sakai. The first part of this lab can be completed in an MS Word document, or it can be completed as comments at the top of your lab1.py file. The second part of this lab (involving the python code) should be saved in a python file (with a.py extension) and turned in as lab1.py. The very last part of this lab should be saved in lab1turtle.py. All files should have both partners names on them and should be submitted by only one partner via Sakai. Because this is a two week lab, we have not covered all material that is necessary to complete this lab yet. If you complete everything we have covered so far in class, skip down to the turtle section. That section can be done with little to no previous knowledge. Part 1: (10 pts) Attendance week of Feb 15: 4 pts Attendance week of Feb 22: 4 pts 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.2 ( 4 pts) : Calculate by hand, then try the formulas using python s shell. Make SURE you get the same answer both ways. a / 2 b. 8 /2 ** 3 * 3

2 c. 9 % 5 * -1 // 3 d. 2 * 13 // / 2 Problem 1.3 (3.5 pts) :Given the following python function and code: 1. def sillyfunc(x): 2. return (x / 5) 3. sillyfunc(3) 4. print (sillyfunc(4)) a) What is the function name? b) What is the input type? c) What is the output type? d) What is the instruction (code) for calculating the function? e) what does line 3 do? f) how does line 4 differ from line 3? g) Once I ve tested this function, how often can I run the function? Do I have to rewrite it? Part 2: (34 pts) Creating Lab1.py in Python: Below here is where your lab1.py (python) file should start. 1. In the IDLE Shell click on File->New Window. 2. An Editor Window should open. 3. Copy and paste the expressions from the previous example into the editor window. Then choose File->Save As... and save it as lab1.py. 4. Run the script by choosing Run->Run Module (or hit f5). If you see nothing in the IDLE window, good job! You should see nothing. That means it s working. 1. Close the file lab1.py. Choose File->Close. 2. Now reopen it. In the IDLE shell, choose File-> Open and locate lab1.py. With this you can save your work, then come back and edit it later. Note: Every function should include comments. The comments for each function should include: The input type and number of inputs The output type 3 Test cases (given this input, you should get this output) And finally an exact description of what the function does (at this point the functions are fairly simple, so a description of what the function does might be something like this function calculates x )

3 Problem 2.1 ( 3 pts): Given the following math function, write (as comment) the input type, the output type, the instruction code (in python), and 3 test cases. Now in your newly created lab1.py file, write the function in python. Call it from the main shell with your test cases to make sure it works (use print in your call to be able to see the results): f(x) = (x -3) x Pat yourself on the back. You are now writing python functions!!!! Problem 2.2 ( 4 pts): Given the following math function, write (as comments) the input type, the output type, the instruction code (in python), and 3 test cases. Now in your lab1.py file, write the function in python. Call it with your test cases to make sure it works. g(x,y) = x(y+2)y+1 x Problem 2.3 (6 pts): Write 2 separate functions, converting the formulas from problem 1.2b and 1.2d into code. Assume each of the integers in the formula is replaced with an input parameter (so, for instance, in the first formula, there would be 3 input parameters). Develop 3 test cases (as comments) for each of the functions, and test them. Problem 2.4 (3 pts): Including comments, write a function that calculates how much to tip at a restaurant (assuming 21%) and returns that amount. Then test it using your test cases. Problem 2.5 (3 pts) Including comments, write a function that calculates and returns how many calories you have burned when running. To calculate the number of calories burned, use the following formula: Where: w/2.2 * 7.5 * m/60 w is your weight (in pounds) m is the number of minutes you ran Problem 2.6 (3 pts): Write a function that takes as input your age as a double (e.g., 18.5), and rounds your age down to the nearest int and returns that number. Make sure you include comments with 3 test cases, and you test your function. Problem 2.7 (4 pts): Write a function that is just slightly different than the above function. In this case, you will round the age up. Note: you should still use floor division. Figure out how to do this using only the tools we ve learned so far in class. Make sure you include comments with 3 test cases, and you test your function. Problem 2.8 (5 pts): Calculating your monthly car payments. Write a function (including comments) that calculates your monthly car payments. To calculate your monthly car payments, you d use the following formula:

4 Where: P ( r 12 ) (1 (1 + r 12 ) m ) P is the principle (the amount you re borrowing to pay for the car, a.k.a. the amount the car cost), r is the interest rate, m is the number of months in which you intend to pay it off. So, for instance (and yes, this can be one of your test cases), if you borrowed $15,000 at a rate of 7% and wanted to pay it off over 3 years (or 36 months), you d calculate your monthly payments as follows: Or per month ( ) (1 ( ) 36 ) Problem 2.9 (3 pts): Moore s law states that the number of transistors that can fit per square inch on an integrated circuit doubles every year without increasing the cost. So say we could fit 32 transistors on an integrated circuit in Then the following chart should hold true: Year: #transistors: Either in your lab text file or as a comment, write the input type, the output type, the function s name, the instruction code, and then test cases for a function that, given the year (after 2001), calculates the number of transistors that will fit on a square inch of integrated circuit. Now in the lab1.py file, write the function and test it with your test cases. Part 3: (39 pts) Problem 3.1 ( 2 pts). Write a function (named no_out) that takes as an input an integer, calculates the square of that integer, but has no output. Problem 3.2 (4 pts). Explain (in comments in your lab1.py file) why this works in python, but is poor form: def f(x,y,z): return(x * y + (y/2 - x) **x) print (f(4,2,3)) and why this doesn t work in python:

5 def g(x,y,z): return(x * y + (y/2 -x)**x) print(g(2,6)) Problem 3.3 a ( 2 pts). Write a function (with comments) that takes as input two integers x and y and calculates y 3 +x 2x 4x 3y b ( 4 pts). Now write a function (including comments) that calculates: 72 + ( y 3 + x 2x 4x 3y 3)2 y 3 + x 2x 4x 3y 3 You must use function you wrote in 3.3a in the code for this function. Problem 3.4( 4 pts): In problem 2.8, you calculated your monthly car payments given your principle, your interest rate, and the amount of time in which you intend to pay the car off. Use the function you wrote in problem 2.8 to calculate the amount of interest you will be paying. Problem 3.5 ( 3 pts): Given the math function: first_if(x) = X if x > 10 x 4 + 7/x otherwise Write the function in python (including comments) Problem 3.6 ( 4 pts). Given the math function: (y* 2) 3 /x if y is less than 5 and x is not equal to 0 second_if(x,y) = (y*3) 2 /x if y is greater than 5 and x is not equal to 0 (y-2)/x if y is equal to 5 and x is not equal to 0-1 otherwise Write the function in python (including comments) Problem 3.7 ( 5 pts). At a used bookstore, different people get different discounts. The rules are as follows: If you are over 65, you get a 40% discount on your total purchase price.

6 If you are over 21 (but 65 or under) you get a 20% discount on your total purchase price. If the discounted price is over $70, you get a 20-dollar discount. If the discounted price is over 50 but 70 or under, you get a 10 dollar discount. If the discounted price is over 30 but 50 or under, you get a 5 dollar discount. Otherwise you just get the 20% discount. If you are over 5 but 21 or under, you get a 30% discount. If your discounted purchase price is over 100, you get another 20 dollars off. Otherwise you just get the 30% discount. Finally, if you are 5 or under, you get a 70% discount on your purchase price (because we want to persuade children to read, of course! Write a function (with comments and test cases) that calculates the amount a person will pay on their purchase at the used bookstore. What are the input parameters? Problem 3.8. We re going to write a program that calculates a person s recommended daily calorie intake to maintain their current weight. To do his, we have to first write a bunch of helper funtions a. ( 1 pt) Write a function (with comments) that takes a person s height in inches and returns their height in centimeters b. ( 1 pt) Write a function (with comments) that takes a person s weight in pounds and returns their weight in kg c. ( 4 pts)write 2 functions (with comments) that take as input a person s height in inches, their weight in pounds, and their age, and calculates a person s BMR (basal metabolic rate). Note: clearly these two fuctions should both use functions a and b that you just wrote! For women (for the female function) the Basal Metabolic Rate is calculated as follows: (3.247x weight in kg) + (3.096 x height in cm) (4.33 x age in years) For men (for the male function) the Basal Metabolic Rate is calculated as follows: (13.397x weight in kg) + (4.799 x height in cm) (5.677 x age in years) d. ( 5 pts) Now write a function (with comments) that calculates your total recommended daily calorie intake needed to maintain your current weight. This is calculated as follows: If you get no exercise: BMR x 1.2 If you get light exercise: BMR x If you get moderate exercise: BMR x 1.55 If you get heavy exercise: BMR x Two hints: you can represent no exercise as the number 0, light exercise as the number 1, moderate as the number 2, and heavy as the number 3. You can also represent Female as 0 and Male as 1. So of your 5 input values to this function, one will hold a number representing whether the person is male or female and one will hold a number representing how much exercise the person gets.

7 Part 4: Intro to Turtle: (9 pts) Turtle is a python library that provides graphics primitives. To use it, open a second file called lab1turtle.py. The very first line of this file needs to import the library, or make the library s functions available to this particular file. So at the top of the file, the first line should be: import turtle (1 pt) Now add the following lines to the file: turtle.forward(50) turtle.forward(50) turtle.forward(50) turtle.forward(50) Now save the file and run it. A separate window should pop up and a square should be drawn. Each time the command turtle.forward(50) is issued, the turtle should move forward 50 pixels. rotates the direction in which the turtle is going by 90 degrees. Problem 4.1 (3 pts): Write a function below the lines of code (above) that takes as input a number, and draws a square with sides the length of that number. Note: this is an example of a function that does not return a value. So the last line of this function should simply be: Turtle colors return() You can change the colors turtle is using to draw a line. You can use different colors to fill the object you drew as well. Colors on the computer are represented in terms of the amount of Red, Green, and Blue (RGB values). In turtle, to set the color to red, I d use the following command: turtle.color(1,0,0) To set the color to blue, I d use: turtle.color(0,0,1) and to set it to green, I d use the following: turtle.color(0,1,0) Thus the first number indicates whether we have red or not, the second whether we have green or not, and the third whether we have blue or not. We can have more than one color: turtle.color(1,0,1)

8 Means we ve got red and blue, and will show up as purple. turtle.color(0,1,1) has both green and blue, and results in cyan (blue-green). And finally, turtle.color(1,1,0) means we ve got red and green and results in YELLOW! Yep, yellow. Finally, if we ve got no red, green, or blue, we have black. So the following: Results in black. turtle.color(0,0,0) And if we have all three colors (red, green, and black), we have white. So the following: turtle.color(1,1,1) Results in white. (1 pt) To see colors, try the following (below your last function): turtle.color(1,0,0) turtle.begin_fill() turtle.forward(100) turtle.left(90) turtle.left(90) turtle.left(90) turtle.forward(60) turtle.left(90) turtle.left(90) turtle.end_fill() turtle.color(0,0,0) turtle.up() turtle.forward(10) turtle.down()

9 turtle.begin_fill() turtle.circle(10) turtle.end_fill() turtle.setheading(0) turtle.up() turtle.forward(90) turtle.forward(10) turtle.setheading(0) turtle.begin_fill() turtle.down() turtle.circle(10) turtle.end_fill() Save the file and run it. We ve got a couple new commands in here: turtle.begin_fill() turtle.end_fill() These commands indicate that the shape we are drawing between the two commands should be filled with the color set in turtle.color. turtle.up() lifts the pen off the page. With this command you can move the turtle around the screen without drawing a line. turtle.down() places the pen back on the screen, so from that point on the pen will draw on the page with each movement. turtle.circle(10) Draws a circle with a radius of 10. And finally, turtle.setheading(0) Sets the heading to 0 th degree, meaning, in this case, facing right. Problem 4.2 (4 pts):

10 Write a function that uses input parameter(s) to determine what color to create an object. Within the function, draw an object, and fill it with the color indicated by the input parameter(s). You can draw whatever you feel like drawing a robot, a flower, a lightbulb, anything you want. Hint on the color: you can either use 3 input parameters, one for red, one for green, and one for blue, or you can use one input parameter that might be 0-7, with 0 being black, 1 being red, 2 being green, 3 being blue, 4 being purple, etc. To Turn In (via Sakai): Part 1 (either as comments in lab1.py or in a separate MS Word document) Part 2 and 3 in lab1.py Part 4 in lab1turtle.py

What you get When you install Python for your computer, you get a number of features:

What you get When you install Python for your computer, you get a number of features: Lab 1 CS161 Exercise 1: In the beginning Why Python? Python is a programming language that was first conceived by Guido van Rossum in the late 1980 s and in 1990. While there are a number of programming

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

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

CSC 101: Lab Manual#11 Programming Turtle Graphics in Python Lab due date: 5:00pm, day after lab session

CSC 101: Lab Manual#11 Programming Turtle Graphics in Python Lab due date: 5:00pm, day after lab session CSC 101: Lab Manual#11 Programming Turtle Graphics in Python Lab due date: 5:00pm, day after lab session Purpose: The purpose of this lab is to get a little introduction to the process of computer programming

More information

Day 1: Introduction to MATLAB and Colorizing Images CURIE Academy 2015: Computational Photography Sign-Off Sheet

Day 1: Introduction to MATLAB and Colorizing Images CURIE Academy 2015: Computational Photography Sign-Off Sheet Day 1: Introduction to MATLAB and Colorizing Images CURIE Academy 2015: Computational Photography Sign-Off Sheet NAME: NAME: Part 1.1 Part 1.2 Part 1.3 Part 2.1 Part 2.2 Part 3.1 Part 3.2 Sign-Off Milestone

More information

Computer Science AP/X CSCI-140/242 Polygons Lab 2 8/30/2018

Computer Science AP/X CSCI-140/242 Polygons Lab 2 8/30/2018 Computer Science AP/X CSCI-140/242 Polygons Lab 2 8/30/2018 1 Implementation You will now implement a program that handles the general case of drawing polygons of decreasing sides, recursively. 1.1 Program

More information

The first print the integer literal 12, the second prints the string comprising the character 1 followed by the character 2.

The first print the integer literal 12, the second prints the string comprising the character 1 followed by the character 2. The Fundamentals 2 Self-Review Questions Self-review 2.1 What are the types of the following literals? 1, 1., 1.0, 1, 1., 1.0, 1, 1., 100000000000000000, 100000000000000000., 100000000000000000.0. int,

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

The Beauty and Joy of Computing 1 Lab Exercise 9: Problem self-similarity and recursion - Python version

The Beauty and Joy of Computing 1 Lab Exercise 9: Problem self-similarity and recursion - Python version The Beauty and Joy of Computing 1 Lab Exercise 9: Problem self-similarity and recursion - Python version Objectives By completing this lab exercise, you should learn to Recognize simple self-similar problems

More information

AREA Judo Math Inc.

AREA Judo Math Inc. AREA 2013 Judo Math Inc. 6 th grade Problem Solving Discipline: Black Belt Training Order of Mastery: Area 1. Area of triangles by composition 2. Area of quadrilaterals by decomposing 3. Draw polygons

More information

Intro to Python Programming

Intro to Python Programming Intro to Python Programming If you re using chromebooks at your school, you can use an online editor called Trinket to code in Python, and you ll have an online portfolio of your projects which you can

More information

Lab 4: Due Sunday, Nov 22

Lab 4: Due Sunday, Nov 22 Lab 4: Due Sunday, Nov 22 Part 1(15 pts): Finish the class project so that it works. For this, you can continue to work with your group, but everyone should turn it in individually. Turn this in separately

More information

MEP Practice Book SA7-9

MEP Practice Book SA7-9 UNITS 7 9 Miscellaneous Exercises Note Starred* questions are for Academic Route only. 1. A B C D Write down the perimeter of shape D. What is the area of shape B? (c) (i) Which shape has the smallest

More information

Introduction to VPython and 3D Computer Modeling

Introduction to VPython and 3D Computer Modeling Introduction to VPython and 3D Computer Modeling OBJECTIVES In this course you will construct computer models to: Visualize motion in 3D Visualize vector quantities like position, momentum, and force in

More information

Understanding the Screen

Understanding the Screen Starting Starting Logo Logo Understanding the Screen Where you will write programs. You can just type methods or commands in here. Ex: t.forward() A Little Logo History What is LOGO? A programming language

More information

In this project, you ll learn how to use a turtle to draw awesome shapes and patterns.

In this project, you ll learn how to use a turtle to draw awesome shapes and patterns. Turtle Power Introduction: In this project, you ll learn how to use a turtle to draw awesome shapes and patterns. Step 1: Hello, turtle! We re going to have some fun programming turtles. A turtle is a

More information

Lab 4: Strings/Loops Due Apr 22 at midnight

Lab 4: Strings/Loops Due Apr 22 at midnight Lab 4: Strings/Loops Due Apr 22 at midnight For this lab, you must work with a partner. All functions should be commented appropriately. If there are random numbers, the function must still be commen ted

More information

CMPSCI 119 LAB #2 Anime Eyes Professor William T. Verts

CMPSCI 119 LAB #2 Anime Eyes Professor William T. Verts CMPSCI 119 LAB #2 Anime Eyes Professor William T. Verts The goal of this Python programming assignment is to write your own code inside a provided program framework, with some new graphical and mathematical

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

CMPSCI 119 LAB #2 Greebles / Anime Eyes Professor William T. Verts

CMPSCI 119 LAB #2 Greebles / Anime Eyes Professor William T. Verts CMPSCI 119 LAB #2 Greebles / Anime Eyes Professor William T. Verts The goal of this Python programming assignment is to write your own code inside a provided program framework, with some new graphical

More information

Basic Unit Quick Start Guide

Basic Unit Quick Start Guide Basic Unit Quick Start Guide Remove Display Module from wrist strap (see Features, page 2) Underside of Band Push Up Install battery underneath copper tab (see Installing/Changing the Battery, page 3)

More information

CS 2316 Individual Homework 1 Python Practice Due: Wednesday, August 28th, before 11:55 PM Out of 100 points

CS 2316 Individual Homework 1 Python Practice Due: Wednesday, August 28th, before 11:55 PM Out of 100 points CS 2316 Individual Homework 1 Python Practice Due: Wednesday, August 28th, before 11:55 PM Out of 100 points Files to submit: 1. HW1.py For Help: - TA Helpdesk Schedule posted on class website. - Email

More information

Quadratics and Their Graphs

Quadratics and Their Graphs Quadratics and Their Graphs Graph each quadratic equation to determine its vertex and x-intercepts. Determine if the vertex is a maximum or minimum value. y = 0.3x + 3x 1 vertex maximum or minimum (circle

More information

COM110: Lab 2 Numeric expressions, strings, and some file processing (chapters 3 and 5)

COM110: Lab 2 Numeric expressions, strings, and some file processing (chapters 3 and 5) COM110: Lab 2 Numeric expressions, strings, and some file processing (chapters 3 and 5) 1) Practice submitting programming assignment 1. Take a few arbitrary modules (.py files) that you have written and

More information

How To Think Like A Computer Scientist, chapter 3; chapter 6, sections

How To Think Like A Computer Scientist, chapter 3; chapter 6, sections 6.189 Day 3 Today there are no written exercises. Turn in your code tomorrow, stapled together, with your name and the file name in comments at the top as detailed in the Day 1 exercises. Readings How

More information

Objectives/Outcomes. Introduction: If we have a set "collection" of fruits : Banana, Apple and Grapes.

Objectives/Outcomes. Introduction: If we have a set collection of fruits : Banana, Apple and Grapes. 1 September 26 September One: Sets Introduction to Sets Define a set Introduction: If we have a set "collection" of fruits : Banana, Apple Grapes. 4 F={,, } Banana is member "an element" of the set F.

More information

Word Prediction Project Due Sunday, May 1

Word Prediction Project Due Sunday, May 1 Word Prediction Project Due Sunday, May 1 For this project you may work with a partner, or you may work alone. Either way you are responsible for getting the project finished and in on time. If you choose

More information

Introduction to VPython This tutorial will guide you through the basics of programming in VPython.

Introduction to VPython This tutorial will guide you through the basics of programming in VPython. 1 Introduction to VPython This tutorial will guide you through the basics of programming in VPython. VPython is a programming language that allows you to easily make 3-D graphics and animations. We will

More information

Part 6b: The effect of scale on raster calculations mean local relief and slope

Part 6b: The effect of scale on raster calculations mean local relief and slope Part 6b: The effect of scale on raster calculations mean local relief and slope Due: Be done with this section by class on Monday 10 Oct. Tasks: Calculate slope for three rasters and produce a decent looking

More information

Introduction to 3D computer modeling

Introduction to 3D computer modeling OBJECTIVES In this course you will construct computer models to: Introduction to 3D computer modeling Visualize motion in 3D Visualize vector quantities like position, momentum, and force in 3D Do calculations

More information

Lab 4: Strings/While Loops Due Sun, Apr 17 at midnight

Lab 4: Strings/While Loops Due Sun, Apr 17 at midnight Lab 4: Strings/While Loops Due Sun, Apr 17 at midnight For this lab, you must work with a partner. You should choose a new partner. Remember to turn in your peer review. All functions should be commented

More information

Measures of Dispersion

Measures of Dispersion Lesson 7.6 Objectives Find the variance of a set of data. Calculate standard deviation for a set of data. Read data from a normal curve. Estimate the area under a curve. Variance Measures of Dispersion

More information

Unit 0: Extending Algebra 1 Concepts

Unit 0: Extending Algebra 1 Concepts 1 What is a Function? Unit 0: Extending Algebra 1 Concepts Definition: ---Function Notation--- Example: f(x) = x 2 1 Mapping Diagram Use the Vertical Line Test Interval Notation A convenient and compact

More information

Whole Numbers. Integers and Temperature

Whole Numbers. Integers and Temperature Whole Numbers Know the meaning of count and be able to count Know that a whole number is a normal counting number such as 0, 1, 2, 3, 4, Know the meanings of even number and odd number Know that approximating

More information

CS 112: Intro to Comp Prog

CS 112: Intro to Comp Prog CS 112: Intro to Comp Prog Importing modules Branching Loops Program Planning Arithmetic Program Lab Assignment #2 Upcoming Assignment #1 Solution CODE: # lab1.py # Student Name: John Noname # Assignment:

More information

Math 101 Final Exam Study Notes:

Math 101 Final Exam Study Notes: Math 101 Final Exam Study Notes: *Please remember there is a large set of final exam review problems in Doc Sharing (under Course Tools in MLP). Highlighted are what might be considered formulas* I. Graph

More information

SCRATCH MODULE 3: NUMBER CONVERSIONS

SCRATCH MODULE 3: NUMBER CONVERSIONS SCRATCH MODULE 3: NUMBER CONVERSIONS INTRODUCTION The purpose of this module is to experiment with user interactions, error checking input, and number conversion algorithms in Scratch. We will be exploring

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

Introduction to VPython for E&M This tutorial will guide you through the basics of programming in VPython

Introduction to VPython for E&M This tutorial will guide you through the basics of programming in VPython Introduction to VPython for E&M This tutorial will guide you through the basics of programming in VPython VPython is a programming language that allows you to easily make 3-D graphics and animations. We

More information

CIS220 In Class/Lab 1: Due Sunday night at midnight. Submit all files through Canvas (25 pts)

CIS220 In Class/Lab 1: Due Sunday night at midnight. Submit all files through Canvas (25 pts) CIS220 In Class/Lab 1: Due Sunday night at midnight. Submit all files through Canvas (25 pts) Problem 0: Install Eclipse + CDT (or, as an alternative, Netbeans). Follow the instructions on my web site.

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

We will start our journey into Processing with creating static images using commands available in Processing:

We will start our journey into Processing with creating static images using commands available in Processing: Processing Notes Chapter 1: Starting Out We will start our journey into Processing with creating static images using commands available in Processing: rect( ) line ( ) ellipse() triangle() NOTE: to find

More information

Chapter 2: Descriptive Statistics (Part 1)

Chapter 2: Descriptive Statistics (Part 1) Frequency 0 2 4 6 8 12 Chapter 2: Descriptive Statistics (Part 1) 2.1: Frequency Distributions and their Graphs Definition A frequency distribution is something (usually a table) that shows what values

More information

New user introduction to Attend

New user introduction to Attend 1 New user introduction to Attend 1. Sign up to Attend... 2 2. First Steps Create a Course... 2 3. Sharing your course... 4 4. Viewing the course participants... 5 5. Create a new member of Staff... 6

More information

CS 051 Homework Laboratory #2

CS 051 Homework Laboratory #2 CS 051 Homework Laboratory #2 Dirty Laundry Objective: To gain experience using conditionals. The Scenario. One thing many students have to figure out for the first time when they come to college is how

More information

Area. Domain 4 Lesson 25. Getting the Idea

Area. Domain 4 Lesson 25. Getting the Idea Domain 4 Lesson 5 Area Common Core Standard: 7.G.6 Getting the Idea The area of a figure is the number of square units inside the figure. Below are some formulas that can be used to find the areas of common

More information

Adobe Illustrator. Quick Start Guide

Adobe Illustrator. Quick Start Guide Adobe Illustrator Quick Start Guide 1 In this guide we will cover the basics of setting up an Illustrator file for use with the laser cutter in the InnovationStudio. We will also cover the creation of

More information

CS106 Lab 1: Getting started with Python, Linux, and Canopy. A. Using the interpreter as a fancy calculator

CS106 Lab 1: Getting started with Python, Linux, and Canopy. A. Using the interpreter as a fancy calculator CS106 Lab 1: Getting started with Python, Linux, and Canopy Dr. Victor Norman Goals: To learn How python can be used interactively for simple computational tasks. How to run Canopy Start playing with Turtle

More information

Art, Nature, and Patterns Introduction

Art, Nature, and Patterns Introduction Art, Nature, and Patterns Introduction to LOGO Describing patterns with symbols This tutorial is designed to introduce you to some basic LOGO commands as well as two fundamental and powerful principles

More information

CS 112: Intro to Comp Prog

CS 112: Intro to Comp Prog CS 112: Intro to Comp Prog Lecture Review Data Types String Operations Arithmetic Operators Variables In-Class Exercises Lab Assignment #2 Upcoming Lecture Topics Variables * Types Functions Purpose Parameters

More information

Pattern Maker Lab. 1 Preliminaries. 1.1 Writing a Python program

Pattern Maker Lab. 1 Preliminaries. 1.1 Writing a Python program Pattern Maker Lab Lab Goals: In this lab, you will write a Python program to generate different patterns using ASCII characters. In particular, you will get practice with the following: 1. Printing strings

More information

Create an Adorable Hedgehog with Basic Tools in Inkscape Aaron Nieze on Sep 23rd 2013 with 5 Comments

Create an Adorable Hedgehog with Basic Tools in Inkscape Aaron Nieze on Sep 23rd 2013 with 5 Comments Create an Adorable Hedgehog with Basic Tools in Inkscape Aaron Nieze on Sep 23rd 2013 with 5 Comments Tutorial Details Software: Inkscape Difficulty: Beginner Completion Time: 2 hours View post on Tuts+

More information

STAAR Category 3 Grade 8 Mathematics TEKS 8.6A/8.6B/8.7A. Student Activity 1

STAAR Category 3 Grade 8 Mathematics TEKS 8.6A/8.6B/8.7A. Student Activity 1 Student Activity 1 Work with your partner to answer the following problems. Problem 1: The bases of a cylinder are two congruent that are to each other. The perpendicular distance between the two bases

More information

Summer Packet 7 th into 8 th grade. Name. Integer Operations = 2. (-7)(6)(-4) = = = = 6.

Summer Packet 7 th into 8 th grade. Name. Integer Operations = 2. (-7)(6)(-4) = = = = 6. Integer Operations Name Adding Integers If the signs are the same, add the numbers and keep the sign. 7 + 9 = 16 - + -6 = -8 If the signs are different, find the difference between the numbers and keep

More information

0 Graphical Analysis Use of Excel

0 Graphical Analysis Use of Excel Lab 0 Graphical Analysis Use of Excel What You Need To Know: This lab is to familiarize you with the graphing ability of excels. You will be plotting data set, curve fitting and using error bars on the

More information

CSc 110, Spring Lecture 11: if / else. Adapted from slides by Marty Stepp and Stuart Reges

CSc 110, Spring Lecture 11: if / else. Adapted from slides by Marty Stepp and Stuart Reges CSc 110, Spring 2018 Lecture 11: if / else Adapted from slides by Marty Stepp and Stuart Reges Exercise: what is wrong with this code? # prints the location of a ball with an initial velocity of 25 accelerating

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

Name 13-6A. 1. Which is the volume of the solid? 2. What is the volume of the solid? A 72 cm 3 B 432 cm 3 C 672 cm 3 D 864 cm 3

Name 13-6A. 1. Which is the volume of the solid? 2. What is the volume of the solid? A 72 cm 3 B 432 cm 3 C 672 cm 3 D 864 cm 3 . Which is the volume of the solid? Quick Check. What is the volume of the solid? 8 in. 9 in. 8 in. A 96 in B 9 in C 0 in D 6 in 8 in. A 7 B C 67 D 86. Writing to Explain Carlos is an architect. He wants

More information

Visit the TA Helpdesk (schedule posted on class website)

Visit the TA Helpdesk (schedule posted on class website) CS 1301 Pair Homework 2 Conversions Due: Monday September 8th, before 11:55pm Out of 100 points Files to submit: hw2.py You will be writing several functions, but they will all be saved in one file: hw2.py.

More information

1 of 39 8/14/2018, 9:48 AM

1 of 39 8/14/2018, 9:48 AM 1 of 39 8/14/018, 9:48 AM Student: Date: Instructor: Alfredo Alvarez Course: Math 0410 Spring 018 Assignment: Math 0410 Homework150bbbbtsiallnew 1. Graph each integer in the list on the same number line.

More information

VIMS Individual Users Guide. How to access your VIMS site, login and use all the features!

VIMS Individual Users Guide. How to access your VIMS site, login and use all the features! VIMS Individual Users Guide www.myvims.com How to access your VIMS site, login and use all the features! Left Click Your Mouse to Advance Slides, Right click to back up one or press ESC to exit presentation.

More information

8 th Grade Math STAAR Review

8 th Grade Math STAAR Review 8 th Grade Math STAAR Review 1. Five students are each trying to raise the same amount of money for a fundraiser. The table below shows how much of each student s goal has been met. Write the numbers in

More information

Lesson 6: Manipulating Equations

Lesson 6: Manipulating Equations Lesson 6: Manipulating Equations Manipulating equations is probably one of the most important skills to master in a high school physics course. Although it is based on familiar (and fairly simple) math

More information

Integer Operations. Summer Packet 7 th into 8 th grade 1. Name = = = = = 6.

Integer Operations. Summer Packet 7 th into 8 th grade 1. Name = = = = = 6. Summer Packet 7 th into 8 th grade 1 Integer Operations Name Adding Integers If the signs are the same, add the numbers and keep the sign. 7 + 9 = 16-2 + -6 = -8 If the signs are different, find the difference

More information

CS 2316 Individual Homework 1 Python Practice Due: Wednesday, January 20 th, before 11:55 PM Out of 100 points

CS 2316 Individual Homework 1 Python Practice Due: Wednesday, January 20 th, before 11:55 PM Out of 100 points CS 2316 Individual Homework 1 Python Practice Due: Wednesday, January 20 th, before 11:55 PM Out of 100 points Files to submit: 1. HW1.py For Help: - TA Helpdesk Schedule posted on class website. - Email

More information

: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics

: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics Assignment 1: Turtle Graphics Page 1 600.112: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics Peter H. Fröhlich phf@cs.jhu.edu Joanne Selinski joanne@cs.jhu.edu Due Date: Wednesdays

More information

Unit 2: Linear Functions

Unit 2: Linear Functions Unit 2: Linear Functions 2.1 Functions in General Functions Algebra is the discipline of mathematics that deals with functions. DEF. A function is, essentially, a pattern. This course deals with patterns

More information

CISC 110 Week 1. An Introduction to Computer Graphics and Scripting

CISC 110 Week 1. An Introduction to Computer Graphics and Scripting CISC 110 Week 1 An Introduction to Computer Graphics and Scripting Emese Somogyvari Office: Goodwin 235 E-mail: somogyva@cs.queensu.ca Please use proper email etiquette! Office hours: TBD Course website:

More information

nostarch.com/pfk For bulk orders, please contact us at

nostarch.com/pfk For bulk orders, please contact us at nostarch.com/pfk For bulk orders, please contact us at sales@nostarch.com. Teacher: Date/Period: Subject: Python Programming Class: Topic: #1 - Getting Started Duration: Up to 50 min. Objectives: Install

More information

Designing and Creating an Academic Poster using PowerPoint

Designing and Creating an Academic Poster using PowerPoint Designing and Creating an Academic Poster using PowerPoint About your poster and the presentation Poster presentations are used at professional conferences to communicate information about your project

More information

Design the Hancock Building

Design the Hancock Building Design the Hancock Building 0. Sign up for Tinkercad and Create a new design On one of the library Macs, single left click one of the icons for Safari, Chrome, or Firefox web browsers in the bottom bar.

More information

Number Sense. I CAN DO THIS! Third Grade Mathematics Name. Problems or Examples. 1.1 I can count, read, and write whole numbers to 10,000.

Number Sense. I CAN DO THIS! Third Grade Mathematics Name. Problems or Examples. 1.1 I can count, read, and write whole numbers to 10,000. Number Sense 1.1 I can count, read, and write whole numbers to 10,000. 1.2 I can compare and order numbers to 10,000. What is the smallest whole number you can make using the digits 4, 3, 9, and 1? Use

More information

Animations that make decisions

Animations that make decisions Chapter 17 Animations that make decisions 17.1 String decisions Worked Exercise 17.1.1 Develop an animation of a simple traffic light. It should initially show a green disk; after 5 seconds, it should

More information

RightStart Mathematics

RightStart Mathematics Most recent update: March 27, 2019 RightStart Mathematics Corrections and Updates for Level G/Grade 6 Lessons and Worksheets, second edition LESSON / WORKSHEET / SOLUTIONS CHANGE DATE CORRECTION OR UPDATE

More information

Problem Solving with Python Challenges 2 Scratch to Python

Problem Solving with Python Challenges 2 Scratch to Python Problem Solving with Python Challenges 2 Scratch to Python Contents 1 Drawing a triangle... 1 2 Generalising our program to draw regular polygons in Scratch and Python... 2 2.1 Drawing a square... 2 2.2

More information

Lab 1 Intro to MATLAB and FreeMat

Lab 1 Intro to MATLAB and FreeMat Lab 1 Intro to MATLAB and FreeMat Objectives concepts 1. Variables, vectors, and arrays 2. Plotting data 3. Script files skills 1. Use MATLAB to solve homework problems 2. Plot lab data and mathematical

More information

CMSC 201 Spring 2017 Lab 01 Hello World

CMSC 201 Spring 2017 Lab 01 Hello World CMSC 201 Spring 2017 Lab 01 Hello World Assignment: Lab 01 Hello World Due Date: Sunday, February 5th by 8:59:59 PM Value: 10 points At UMBC, our General Lab (GL) system is designed to grant students the

More information

2500( ) ( ) ( ) 3

2500( ) ( ) ( ) 3 Name: *Don't forget to use your Vertical Line Test! Mr. Smith invested $,00 in a savings account that earns % interest compounded annually. He made no additional deposits or withdrawals. Which expression

More information

Introduction to Programming with JES

Introduction to Programming with JES Introduction to Programming with JES Titus Winters & Josef Spjut October 6, 2005 1 Introduction First off, welcome to UCR, and congratulations on becoming a Computer Engineering major. Excellent choice.

More information

Com S 127 Lab 2. For the first two parts of the lab, start up Wing 101 and use the Python shell window to try everything out.

Com S 127 Lab 2. For the first two parts of the lab, start up Wing 101 and use the Python shell window to try everything out. Com S 127 Lab 2 Checkpoint 0 Please open the CS 127 Blackboard page and click on Groups in the menu at left. Sign up for the group corresponding to the lab section you are attending. Also, if you haven't

More information

Math 6 Unit 9 Notes: Measurement and Geometry, Area/Volume

Math 6 Unit 9 Notes: Measurement and Geometry, Area/Volume Math 6 Unit 9 Notes: Measurement and Geometry, rea/volume erimeter Objectives: (5.5) The student will model formulas to find the perimeter, circumference and area of plane figures. (5.6) The student will

More information

Loki s Practice Sets for PUBP555: Math Camp Spring 2014

Loki s Practice Sets for PUBP555: Math Camp Spring 2014 Loki s Practice Sets for PUBP555: Math Camp Spring 2014 Contents Module 1... 3 Rounding Numbers... 3 Square Roots... 3 Working with Fractions... 4 Percentages... 5 Order of Operations... 6 Module 2...

More information

n! = 1 * 2 * 3 * 4 * * (n-1) * n

n! = 1 * 2 * 3 * 4 * * (n-1) * n The Beauty and Joy of Computing 1 Lab Exercise 9: Problem self-similarity and recursion Objectives By completing this lab exercise, you should learn to Recognize simple self-similar problems which are

More information

Polygons and Angles: Student Guide

Polygons and Angles: Student Guide Polygons and Angles: Student Guide You are going to be using a Sphero to figure out what angle you need the Sphero to move at so that it can draw shapes with straight lines (also called polygons). The

More information

Introduction to Google SketchUp

Introduction to Google SketchUp Introduction to Google SketchUp When initially opening SketchUp, it will be useful to select the Google Earth Modelling Meters option from the initial menu. If this menu doesn t appear, the same option

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

Question. Insight Through

Question. Insight Through Intro Math Problem Solving October 10 Question about Accuracy Rewrite Square Root Script as a Function Functions in MATLAB Road Trip, Restaurant Examples Writing Functions that Use Lists Functions with

More information

Loki s Practice Sets for PUBP555: Math Camp Spring 2014

Loki s Practice Sets for PUBP555: Math Camp Spring 2014 Loki s Practice Sets for PUBP555: Math Camp Spring 2014 Contents Module 1... 3 Rounding Numbers... 3 Square Roots... 3 Working with Fractions... 3 Percentages... 3 Order of Operations... 4 Module 2...

More information

CONTENTS. Functional Maths and Numeracy study guide Name 1) THE FOUR RULES OF ARITHMETIC 6) ROUNDING 2) MEASURES, SHAPE AND SPACE 8) NEGATIVE NUMBERS

CONTENTS. Functional Maths and Numeracy study guide Name 1) THE FOUR RULES OF ARITHMETIC 6) ROUNDING 2) MEASURES, SHAPE AND SPACE 8) NEGATIVE NUMBERS Name CONTENTS 1) THE FOUR RULES OF ARITHMETIC Addition (page 2) Addition of decimals (page 4) Subtraction (page 5) Subtraction of decimals (page 8) Subtraction other methods (page 9) Multiplication (page

More information

Intro to Event-Driven Programming

Intro to Event-Driven Programming Unit 5. Lessons 1 to 5 AP CS P We roughly follow the outline of assignment in code.org s unit 5. This is a continuation of the work we started in code.org s unit 3. Occasionally I will ask you to do additional

More information

Omega elearning Helpful Hints and Basic Navigation

Omega elearning Helpful Hints and Basic Navigation Omega elearning Helpful Hints and Basic Navigation Welcome to Omega s elearning experience. This document contains three sections: Section title and description 1. Omega/NetDimensions Navigation Locating

More information

Tanita Health Ware Help

Tanita Health Ware Help Tanita Health Ware Help Getting Started Managing Users Measurements Analysis Graphs Files & Sharing Exporting ANT Scale Installation Using Garmin Watches Bluetooth Scale Installation Getting Started The

More information

Matlab for FMRI Module 1: the basics Instructor: Luis Hernandez-Garcia

Matlab for FMRI Module 1: the basics Instructor: Luis Hernandez-Garcia Matlab for FMRI Module 1: the basics Instructor: Luis Hernandez-Garcia The goal for this tutorial is to make sure that you understand a few key concepts related to programming, and that you know the basics

More information

1. (10 pts) Order the following three images by how much memory they occupy:

1. (10 pts) Order the following three images by how much memory they occupy: CS 47 Prelim Tuesday, February 25, 2003 Problem : Raster images (5 pts). (0 pts) Order the following three images by how much memory they occupy: A. a 2048 by 2048 binary image B. a 024 by 024 grayscale

More information

Objet30 Pro x 7.55 x mm. Acrylic-like plastic in solid color. White, gray, black, clear

Objet30 Pro x 7.55 x mm. Acrylic-like plastic in solid color. White, gray, black, clear Guide for 3D Printing Table of contents: Objet30 Pro Estimation: Page 5 Dimension Estimation: Page 6 Form 1+ Estimation: Page 7 General Information Location:, 1232 Sullivan Access: Technician-run; Online

More information

Excel Functions & Tables

Excel Functions & Tables Excel Functions & Tables SPRING 2016 Spring 2016 CS130 - EXCEL FUNCTIONS & TABLES 1 Review of Functions Quick Mathematics Review As it turns out, some of the most important mathematics for this course

More information

Introduction to VPython This tutorial will guide you through the basics of programming in VPython.

Introduction to VPython This tutorial will guide you through the basics of programming in VPython. Introduction to VPython This tutorial will guide you through the basics of programming in VPython. VPython is a programming language that allows you to easily make 3-D graphics and animations. We will

More information

Late Penalty: Late assignments will not be accepted.

Late Penalty: Late assignments will not be accepted. CPSC 449 Assignment 1 Due: Monday, October 16, 2017 Sample Solution Length: Less than 100 lines to reach the A- level, including some comments Approximately 130 lines with the fill color being influenced

More information

Turtle Graphics and L-systems Informatics 1 Functional Programming: Tutorial 7

Turtle Graphics and L-systems Informatics 1 Functional Programming: Tutorial 7 Turtle Graphics and L-systems Informatics 1 Functional Programming: Tutorial 7 Heijltjes, Wadler Due: The tutorial of week 9 (20/21 Nov.) Reading assignment: Chapters 15 17 (pp. 280 382) Please attempt

More information

Lecture 3. Functions & Modules

Lecture 3. Functions & Modules Lecture 3 Functions & Modules Labs this Week Lab 1 is due at the beginning of your lab If it is not yet by then, you cannot get credit Only exception is for students who added late (Those students should

More information