CSC 110 Final Exam. ID checked

Size: px
Start display at page:

Download "CSC 110 Final Exam. ID checked"

Transcription

1 ID checked CSC 110 Final Exam Name: Date: 1. Write a Python program that asks the user for a positive integer n and prints out n evenly spaced values between 0 and 10. The values should be printed with 3 places following the decimal point. Invalid values shall print an error message instead. Here is an example with the input value 5. Enter a number: Write a Python function named mean. This function takes a single parameter, a list of integer values. It returns the arithmetic mean of the values in the list. For full credit, use only one loop and do not use any built-in functions. For extra-credit, create a second implementation using built-in functions. (Hint: the e-c one is two lines long, including the def line.) For example, mean([1, 2, 3, 4]) 2.5

2 CSC 110 Final Exam 2 Initials The following three (3) questions are related. 3. Write a Python function named word_count that takes one str parameter: the input filename. The function shall open the input file, read its contents, and print out the line count, word count, character count, and input filename (to standard output). This same text should be written into a log file named word_count.log. Each call to the word_count function adds a single line to word_count.log. (For extra credit, only open the file once per function call.) For example, if the input file is seuss.txt, the printed line should be: seuss.txt. seuss.txt (the newline character immediately follows the last letter in each line one fish two fish red fish blue fish I am Sam, Sam I am. Do you like green eggs and ham?

3 CSC 110 Final Exam 3 Initials 4. In the space below, update the module to include a testing main function that calls your function. For the input file, use seuss.txt. The testing main should run when the module itself is run, but not when the module is imported. 5. There are exceptions (errors) that could possibly occur when running this function. Describe the conditions that could cause errors. There is no need to write handling code in your function for these errors. For extra-credit, list the Python keywords that would be used to handle these exceptions. 6. Which of the following is true about the global keyword? (Mark with T or F.) The global keyword makes it possible for a function to use the value of a global variable. The global keyword creates a global variable even if the variable is not named outside of any function. The global keyword can only be used outside of functions. The global keyword is used to create Python constants. The global keyword creates a variable that can be shared between different Python programs. 7. Write a Python function that takes two parameters, r and h, that returns the volume of a right circular cone of radius r and height h. You may assume that r and h are floats. volume = ⅓π r² h

4 CSC 110 Final Exam 4 Initials The following four (4) questions are related. 8. Complete the code to draw following window. Each of the four figures is 100x100 pixels. The yellow background is 240x240 pixels overall. The borders of the magenta square, the cyan circle, and the green square are 5 pixels wide. The lines in the red > are 12 pixels wide. Unless otherwise given, assume the color is black. (This can be done in less than 10 additional lines of code). import Gui3 win = Gui3.Gui() canvas = win.ca(250, 250) win.mainloop() 9. What is the effect of the first line of code? import Gui3 10. What is the effect of the last line of code? win.mainloop()

5 CSC 110 Final Exam 5 Initials 11. How would the code have to change, if it all, if the first line were rewritten as: from Gui3 import Gui 12. Tuples in Python are described as immutable. What does this term mean? What is the corresponding mutable structure in Python? For extra credit, give an example of what immutability allows/prohibits when working with tuples in Python. For the following 4 questions, consider the following declaration: text = 'widescreen' 13. Write Python code to get the letter r from the string text. 14. Write Python code to get the letter sequence ides as a single unit from the string text. (Extra credit: what is the term for this process.) 15. Write Python code to create the string wren, using the fewest sections of the string text. 16. What is the value of the following expression: text[1::3] 17. Write a Python function that takes three parameters, a, b, and c, that returns the positive root of a quadratic equation: ax 2 + bx +c. You may assume a, b, and c are floats. b root b 2 4ac 2a

6 CSC 110 Final Exam 6 Initials 18. Briefly describe the differences between syntax errors and logical errors. Example can be very helpful here, but are not required. For the following 4 questions, consider the following code fragment: text = 'ab = a*b' for c in text: print(c, sep=' ', end='\n') for c in text: print(c, sep='\n', end=' ') print(text) 19. Give the output that will be printed by these lines of code. Use an underscore _ to indicate a space; an arrow to indicate a newline 20. How many visible characters (characters that have black in them) are output? 21. How many spaces are output? 22. How many newline characters are output?

CMPSCI 119 Spring 2015 Final Exam Friday, May 1, 2015 Solution Key

CMPSCI 119 Spring 2015 Final Exam Friday, May 1, 2015 Solution Key CMPSCI 119 Spring 2015 Final Exam Friday, May 1, 2015 Solution Key 25 Points Answer any 25 questions. Answer more for extra credit. Be careful about which variables and constants are integers, which

More information

PYTHON. Values and Variables

PYTHON. Values and Variables December 13 2017 Naveen Sagayaselvaraj PYTHON Values and Variables Overview Integer Values Variables and Assignment Identifiers Floating-point Types User Input The eval Function Controlling the print Function

More information

Question 1. [5 points] Circle and briefly explain the error(s) in the following code:

Question 1. [5 points] Circle and briefly explain the error(s) in the following code: CS 101, Spring 2017 Feb 14th Exam 1 Name: Question 1. [5 points] Circle and briefly explain the error(s) in the following code: double x, y; result = (x)(x) + y; printf("%lf\n", result); Question 2. [10

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

Python Programming Exercises 1

Python Programming Exercises 1 Python Programming Exercises 1 Notes: throughout these exercises >>> preceeds code that should be typed directly into the Python interpreter. To get the most out of these exercises, don t just follow them

More information

Object Oriented Programming Using C++ Mathematics & Computing IET, Katunayake

Object Oriented Programming Using C++ Mathematics & Computing IET, Katunayake Assigning Values // Example 2.3(Mathematical operations in C++) float a; cout > a; cout

More information

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2 15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2 Name Section Directions: Answer each question neatly in the space provided. Please read each question carefully. You have 50 minutes for this exam. No electronic

More information

CMPSCI 119 Fall 2018 Thursday, November 29, 2018 Midterm #3 Solution Key Professor William T. Verts

CMPSCI 119 Fall 2018 Thursday, November 29, 2018 Midterm #3 Solution Key Professor William T. Verts CMPSCI 119 Fall 2018 Thursday, November 29, 2018 Midterm #3 Solution Key Professor William T. Verts 25 Points What is the value of each expression below? Answer any 25; answer more for extra credit.

More information

Expressions and Variables

Expressions and Variables Expressions and Variables Expressions print(expression) An expression is evaluated to give a value. For example: 2 + 9-6 Evaluates to: 5 Data Types Integers 1, 2, 3, 42, 100, -5 Floating points 2.5, 7.0,

More information

Python Lists: Example 1: >>> items=["apple", "orange",100,25.5] >>> items[0] 'apple' >>> 3*items[:2]

Python Lists: Example 1: >>> items=[apple, orange,100,25.5] >>> items[0] 'apple' >>> 3*items[:2] Python Lists: Lists are Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]). All the items belonging to a list can be of different data type.

More information

Question 2. [5 points] Given the following symbolic constant definition

Question 2. [5 points] Given the following symbolic constant definition CS 101, Spring 2012 Mar 20th Exam 2 Name: Question 1. [5 points] Determine which of the following function calls are valid for a function with the prototype: void drawrect(int width, int height); Assume

More information

Algorithms and Programming I. Lecture#12 Spring 2015

Algorithms and Programming I. Lecture#12 Spring 2015 Algorithms and Programming I Lecture#12 Spring 2015 Think Python How to Think Like a Computer Scientist By :Allen Downey Installing Python Follow the instructions on installing Python and IDLE on your

More information

Spring Semester 11 Exam #1 Dr. Dillon. (02/15)

Spring Semester 11 Exam #1 Dr. Dillon. (02/15) Spring Semester 11 Exam #1 Dr. Dillon. (02/15) Form 1 A Last name (printed): First name (printed): Directions: a) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN. b) You may use one 8.5"

More information

CS110 Introduction to Computing Fall 2006 Midterm Exam

CS110 Introduction to Computing Fall 2006 Midterm Exam CS110 Introduction to Computing Fall 2006 Midterm Exam Name: This is an open book/notes exam. Sharing of notes and books is not permitted. Answer all questions in the space provided. Continue on back of

More information

GCSE LINKED PAIR PILOT 4364/02 METHODS IN MATHEMATICS UNIT 2: Methods (Calculator) HIGHER TIER

GCSE LINKED PAIR PILOT 4364/02 METHODS IN MATHEMATICS UNIT 2: Methods (Calculator) HIGHER TIER Surname Other Names Centre Number 0 Candidate Number GCSE LINKED PAIR PILOT 4364/02 METHODS IN MATHEMATICS UNIT 2: Methods (Calculator) HIGHER TIER A.M. MONDAY, 17 June 2013 2 hours ADDITIONAL MATERIALS

More information

Introduction to Matlab

Introduction to Matlab What is Matlab? Introduction to Matlab Matlab is software written by a company called The Mathworks (mathworks.com), and was first created in 1984 to be a nice front end to the numerical routines created

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

Solution Notes. COMP 151: Terms Test

Solution Notes. COMP 151: Terms Test Family Name:.............................. Other Names:............................. ID Number:............................... Signature.................................. Solution Notes COMP 151: Terms

More information

CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random. Adapted from slides by Marty Stepp and Stuart Reges

CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random. Adapted from slides by Marty Stepp and Stuart Reges CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random Adapted from slides by Marty Stepp and Stuart Reges Exercise: multiple parameters def main(): print_number(4, 9) print_number(17, 6) print_number(8,

More information

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

Sketching graphs of polynomials

Sketching graphs of polynomials Sketching graphs of polynomials We want to draw the graphs of polynomial functions y = f(x). The degree of a polynomial in one variable x is the highest power of x that remains after terms have been collected.

More information

CMSC330 Fall 2016 Midterm #1 2:00pm/3:30pm

CMSC330 Fall 2016 Midterm #1 2:00pm/3:30pm CMSC330 Fall 2016 Midterm #1 2:00pm/3:30pm Name: Discussion Time: 10am 11am 12pm 1pm 2pm 3pm TA Name (Circle): Alex Austin Ayman Brian Damien Daniel K. Daniel P. Greg Tammy Tim Vitung Will K. Instructions

More information

Deferred Rendering Due: Wednesday November 15 at 10pm

Deferred Rendering Due: Wednesday November 15 at 10pm CMSC 23700 Autumn 2017 Introduction to Computer Graphics Project 4 November 2, 2017 Deferred Rendering Due: Wednesday November 15 at 10pm 1 Summary This assignment uses the same application architecture

More information

NO CALCULATOR ALLOWED

NO CALCULATOR ALLOWED Round 1: Arithmetic All answers must be in simplest exact form in the answer section 1 1. If a #b = a b! a, evaluate: (3#5)! (5#3) 2. If a!b represents a% of (a + b), p! q represents q% of (p! q), and

More information

Summer Math Assignments for Students Entering Integrated Math

Summer Math Assignments for Students Entering Integrated Math Summer Math Assignments for Students Entering Integrated Math Purpose: The purpose of this packet is to review pre-requisite skills necessary for the student to be successful in Integrated Math. You are

More information

CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts

CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts 25 Points What is the value of each expression below? Answer any 25; answer more for extra credit.

More information

Variable and Data Type 2

Variable and Data Type 2 The Islamic University of Gaza Faculty of Engineering Dept. of Computer Engineering Intro. To Computers (LNGG 1003) Lab 3 Variable and Data Type 2 Eng. Ibraheem Lubbad March 2, 2017 Python Lists: Lists

More information

PROGRAMMING IN C AND C++:

PROGRAMMING IN C AND C++: PROGRAMMING IN C AND C++: Week 1 1. Introductions 2. Using Dos commands, make a directory: C:\users\YearOfJoining\Sectionx\USERNAME\CS101 3. Getting started with Visual C++. 4. Write a program to print

More information

General Certificate of Secondary Education Higher Tier June 2014

General Certificate of Secondary Education Higher Tier June 2014 Centre Number Surname Candidate Number For Examiner s Use Other Names Candidate Signature Examiner s Initials Pages Mark Mathematics General Certificate of Secondary Education Higher Tier June 2014 43603H

More information

CSCS 261 Programming Concepts Exam 1 Fall EXAM 1 VERSION 1 Fall Points. Absolutely no electronic devices may be used during this exam.

CSCS 261 Programming Concepts Exam 1 Fall EXAM 1 VERSION 1 Fall Points. Absolutely no electronic devices may be used during this exam. Name: Print legibly! Section: COMPUTER SCIENCE 261 PROGRAMMING CONCEPTS EXAM 1 VERSION 1 Fall 2014 150 Points Absolutely no electronic devices may be used during this exam. 1. No cell phones, computers,

More information

CS 115 Exam 1, Fall 2015 Thu. 09/24/2015

CS 115 Exam 1, Fall 2015 Thu. 09/24/2015 CS 115 Exam 1, Fall 2015 Thu. 09/24/2015 Name: Section: Rules and Hints You may use one handwritten 8.5 11 cheat sheet (front and back). This is the only additional resource you may consult during this

More information

Variable and Data Type I

Variable and Data Type I Islamic University Of Gaza Faculty of Engineering Computer Engineering Department Lab 2 Variable and Data Type I Eng. Ibraheem Lubbad September 24, 2016 Variable is reserved a location in memory to store

More information

UNIT 8: SOLVING AND GRAPHING QUADRATICS. 8-1 Factoring to Solve Quadratic Equations. Solve each equation:

UNIT 8: SOLVING AND GRAPHING QUADRATICS. 8-1 Factoring to Solve Quadratic Equations. Solve each equation: UNIT 8: SOLVING AND GRAPHING QUADRATICS 8-1 Factoring to Solve Quadratic Equations Zero Product Property For all numbers a & b Solve each equation: If: ab 0, 1. (x + 3)(x 5) = 0 Then one of these is true:

More information

K.S.E.E.B., Malleshwaram, Bangalore SSLC Model Question Paper-2 (2015) MATHEMATICS

K.S.E.E.B., Malleshwaram, Bangalore SSLC Model Question Paper-2 (2015) MATHEMATICS Max Marks: 80 No. of Questions: 40 K.S.E.E.B., Malleshwaram, Bangalore SSLC Model Question Paper- (015) MATHEMATICS 81E Time: Hours 45 minutes Code No. : 81E Four alternatives are given for the each question.

More information

Making the Gradient. Create a Linear Gradient Swatch. Follow these instructions to complete the Making the Gradient assignment:

Making the Gradient. Create a Linear Gradient Swatch. Follow these instructions to complete the Making the Gradient assignment: Making the Gradient Follow these instructions to complete the Making the Gradient assignment: Create a Linear Gradient Swatch 1) Save the Making the Gradient file (found on Mrs. Burnett s website) to your

More information

Mathematics Class 10 Board Sample paper-2

Mathematics Class 10 Board Sample paper-2 1 Mathematics Class 10 Board Sample paper-2 Time allowed: 3 hours Maximum Marks: 80 General Instructions: a) All questions are compulsory. b) The question paper consists of 30 questions divided into four

More information

CMPE Experiment 3 Selective Structures

CMPE Experiment 3 Selective Structures Page1 CMPE 108 - Experiment 3 Selective Structures OBJECTIVES: Understand how to edit, compile and execute C computer codes. Understand C programming: sequential and selective structures NOTES: You should

More information

(b) If a heap has n elements, what s the height of the tree?

(b) If a heap has n elements, what s the height of the tree? CISC 5835 Algorithms for Big Data Fall, 2018 Homework Assignment #4 1 Answer the following questions about binary tree and heap: (a) For a complete binary tree of height 4 (we consider a tree with just

More information

Lecture 7. Memory in Python

Lecture 7. Memory in Python Lecture 7 Memory in Python Announcements For This Lecture Readings Reread Chapter 3 No reading for Thursday Lab Work on Assignment Credit when submit A Nothing else to do Assignment Moved to Fri, Sep.

More information

Introduction to Computer Programming CSCI-UA 2. Review Midterm Exam 1

Introduction to Computer Programming CSCI-UA 2. Review Midterm Exam 1 Review Midterm Exam 1 Review Midterm Exam 1 Exam on Monday, October 7 Data Types and Variables = Data Types and Variables Basic Data Types Integers Floating Point Numbers Strings Data Types and Variables

More information

CMPSCI 119 Spring 2017 Wednesday, March 29, 2017 Midterm #2 Professor William T. Verts QUESTION POINTS SCORE TOTAL 100

CMPSCI 119 Spring 2017 Wednesday, March 29, 2017 Midterm #2 Professor William T. Verts QUESTION POINTS SCORE TOTAL 100 CMPSCI 119 Spring 2017 Wednesday, March 29, 2017 Midterm #2 Professor William T. Verts NAME QUESTION POINTS SCORE 1 25+5 2 5 3 24 4 20 5 16 6 10 TOTAL 100 25 Points What is the value of each expression

More information

CS 1301 Exam 1 Answers Fall 2009

CS 1301 Exam 1 Answers Fall 2009 Page 1/6 CS 1301 Fall 2009 Exam 1 Your Name: I commit to uphold the ideals of honor and integrity by refusing to betray the trust bestowed upon me as a member of the Georgia Tech community. CS 1301 Exam

More information

Variable and Data Type I

Variable and Data Type I The Islamic University of Gaza Faculty of Engineering Dept. of Computer Engineering Intro. To Computers (LNGG 1003) Lab 2 Variable and Data Type I Eng. Ibraheem Lubbad February 18, 2017 Variable is reserved

More information

Linear, Quadratic, Exponential, and Absolute Value Functions

Linear, Quadratic, Exponential, and Absolute Value Functions Linear, Quadratic, Exponential, and Absolute Value Functions Linear Quadratic Exponential Absolute Value Y = mx + b y = ax 2 + bx + c y = a b x y = x 1 What type of graph am I? 2 What can you tell me about

More information

MATH 1075 Final Exam

MATH 1075 Final Exam Autumn 2018 Form C Name: Signature: OSU name.#: Lecturer: Recitation Instructor: Recitation Time: MATH 1075 Final Exam Instructions: You will have 1 hour and 45 minutes to take the exam. Show ALL work

More information

CS Exam 2 Name: Your Grading TA: This exam has 7 pages including the title page. Please check to make sure all pages are included.

CS Exam 2 Name: Your Grading TA: This exam has 7 pages including the title page. Please check to make sure all pages are included. CS1301 - Exam 2 Name: Your Grading TA: Instructions: Please write clearly. What I cannot read, I will not grade. Show all your work in detail. I give partial credit. This exam has 7 pages including the

More information

1 Introduction to Matlab

1 Introduction to Matlab 1 Introduction to Matlab 1. What is Matlab? Matlab is a computer program designed to do mathematics. You might think of it as a super-calculator. That is, once Matlab has been started, you can enter computations,

More information

Our Strategy for Learning Fortran 90

Our Strategy for Learning Fortran 90 Our Strategy for Learning Fortran 90 We want to consider some computational problems which build in complexity. evaluating an integral solving nonlinear equations vector/matrix operations fitting data

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

CSE2003: System Programming Final Exam. (Spring 2009)

CSE2003: System Programming Final Exam. (Spring 2009) CSE2003: System Programming Final Exam. (Spring 2009) 3:00PM 5:00PM, June 17, 2009. Instructor: Jin Soo Kim Student ID: Name: 1. Write the full name of the following acronym. (25 points) (1) GNU ( ) (2)

More information

CS 1301 Exam 2 Fall 2010

CS 1301 Exam 2 Fall 2010 CS 1301 Exam 2 Fall 2010 Name : Grading TA: Devices: If your cell phone, pager, PDA, beeper, ipod, or similar item goes off during the exam, you will lose 10 points on this exam. Turn all such devices

More information

College Algebra. Quadratic Functions and their Graphs. Dr. Nguyen October 12, Department of Mathematics UK

College Algebra. Quadratic Functions and their Graphs. Dr. Nguyen October 12, Department of Mathematics UK College Algebra Quadratic Functions and their Graphs Dr. Nguyen nicholas.nguyen@uky.edu Department of Mathematics UK October 12, 2018 Agenda Quadratic functions and their graphs Parabolas and vertices

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

CS1110 Lab 5: Practice for A4 (Mar 8-9, 2016) First Name: Last Name: NetID:

CS1110 Lab 5: Practice for A4 (Mar 8-9, 2016) First Name: Last Name: NetID: CS1110 Lab 5: Practice for A4 (Mar 8-9, 2016) First Name: Last Name: NetID: The lab assignments are very important. Remember this: The lab problems feed into the assignments and the assignments define

More information

2. The Wheel of Theodorus in Problem 4.1 includes only the first 11 triangles in the wheel. The wheel can go on forever.

2. The Wheel of Theodorus in Problem 4.1 includes only the first 11 triangles in the wheel. The wheel can go on forever. A C E Applications Connections Extensions Applications 1. The hypotenuse of a right triangle is 15 centimeters long. One leg is 9 centimeters long. How long is the other leg? 2. The Wheel of Theodorus

More information

General Certificate of Secondary Education Higher Tier November Time allowed 1 hour 30 minutes

General Certificate of Secondary Education Higher Tier November Time allowed 1 hour 30 minutes Centre Number Surname Candidate Number For Examiner s Use Other Names Candidate Signature Examiner s Initials Pages Mark Mathematics General Certificate of Secondary Education Higher Tier November 2014

More information

Cambridge International Examinations CambridgeOrdinaryLevel

Cambridge International Examinations CambridgeOrdinaryLevel www.onlineexamhelp.com Cambridge International Examinations CambridgeOrdinaryLevel * 8 1 2 6 0 6 2 8 4 7 * ADDITIONAL MATHEMATICS 4037/12 Paper1 May/June 2014 2 hours CandidatesanswerontheQuestionPaper.

More information

x 2 + 8x - 12 = 0 Aim: To review for Quadratic Function Exam #1 Homework: Study Review Materials

x 2 + 8x - 12 = 0 Aim: To review for Quadratic Function Exam #1 Homework: Study Review Materials Aim: To review for Quadratic Function Exam #1 Homework: Study Review Materials Do Now - Solve using any strategy. If irrational, express in simplest radical form x 2 + 8x - 12 = 0 Review Topic Index 1.

More information

Programming Project 1

Programming Project 1 Programming Project 1 Handout 6 CSCI 134: Fall, 2016 Guidelines A programming project is a laboratory that you complete on your own, without the help of others. It is a form of take-home exam. You may

More information

x + 1 = 2 Write x as a fraction in the form a, where a and b are positive integers with no common factor other than 1. Pass on the value of b a.

x + 1 = 2 Write x as a fraction in the form a, where a and b are positive integers with no common factor other than 1. Pass on the value of b a. A1 Solve for x the equation x + 1 = 2 x. Write x as a fraction in the form a, where a and b are positive b integers with no common factor other than 1. Pass on the value of b a. A3 ABCD is a square that

More information

ROSE-HULMAN INSTITUTE OF TECHNOLOGY

ROSE-HULMAN INSTITUTE OF TECHNOLOGY EXAM 2 WRITTEN PORTION NAME SECTION NUMBER CAMPUS MAILBOX NUMBER EMAIL ADDRESS @rose-hulman.edu Written Portion / 48 Computer Portion / 52 Total / 100 ROSE-HULMAN INSTITUTE OF TECHNOLOGY USE MATLAB SYNTAX

More information

THE UNIVERSITY OF MANITOBA

THE UNIVERSITY OF MANITOBA THE UNIVERSITY OF MANITOBA MATHEMATICS 3400 (Combinatorics I) March 4, 2011 MIDTERM EAM 2 hours (6-8 PM) EAMINER: R. Craigen Total Marks: 100 NAME: STUDENT NUMBER: INSTRUCTIONS Write your name and student

More information

Mirage. Language Reference Manual. Image drawn using Mirage 1.1. Columbia University COMS W4115 Programming Languages and Translators Fall 2006

Mirage. Language Reference Manual. Image drawn using Mirage 1.1. Columbia University COMS W4115 Programming Languages and Translators Fall 2006 Mirage Language Reference Manual Image drawn using Mirage 1.1 Columbia University COMS W4115 Programming Languages and Translators Fall 2006 Prof. Stephen Edwards Team Members: Abhilash I ai2160@columbia.edu

More information

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

More information

GEOMETRY SEMESTER 2 REVIEW PACKET 2016

GEOMETRY SEMESTER 2 REVIEW PACKET 2016 GEOMETRY SEMESTER 2 REVIEW PACKET 2016 Your Geometry Final Exam will take place on Friday, May 27 th, 2016. Below is the list of review problems that will be due in order to prepare you: Assignment # Due

More information

CS 1301 Exam 1 Fall 2009

CS 1301 Exam 1 Fall 2009 Page 1/6 CS 1301 Fall 2009 Exam 1 Your Name: I commit to uphold the ideals of honor and integrity by refusing to betray the trust bestowed upon me as a member of the Georgia Tech community. CS 1301 Exam

More information

LabVIEW Case and Loop Structures ABE 4423/6423 Dr. Filip To Ag and Bio Engineering, Mississippi State University

LabVIEW Case and Loop Structures ABE 4423/6423 Dr. Filip To Ag and Bio Engineering, Mississippi State University LabVIEW Case and Loop Structures ABE 4423/6423 Dr. Filip To Ag and Bio Engineering, Mississippi State University Recap Previous Homework Following Instruction Create a Pressure Conversion VI that takes

More information

NAME: 1a. (10 pts.) Describe the characteristics of numbers for which this floating-point data type is well-suited. Give an example.

NAME: 1a. (10 pts.) Describe the characteristics of numbers for which this floating-point data type is well-suited. Give an example. MSU CSC 285 Spring, 2007 Exam 2 (5 pgs.) NAME: 1. Suppose that a eight-bit floating-point data type is defined with the eight bits divided into fields as follows, where the bits are numbered with zero

More information

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

Lecture Numbers. Richard E Sarkis CSC 161: The Art of Programming

Lecture Numbers. Richard E Sarkis CSC 161: The Art of Programming Lecture Numbers Richard E Sarkis CSC 161: The Art of Programming Class Administrivia Agenda To understand the concept of data types To be familiar with the basic numeric data types in Python To be able

More information

SFPL Reference Manual

SFPL Reference Manual 1 SFPL Reference Manual By: Huang-Hsu Chen (hc2237) Xiao Song Lu(xl2144) Natasha Nezhdanova(nin2001) Ling Zhu(lz2153) 2 1. Lexical Conventions 1.1 Tokens There are six classes of tokes: identifiers, keywords,

More information

CSCE 110 Programming I Basics of Python: Lists, Tuples, and Functions

CSCE 110 Programming I Basics of Python: Lists, Tuples, and Functions CSCE 110 Programming I Basics of Python: Lists, Tuples, and Functions Dr. Tiffani L. Williams Department of Computer Science and Engineering Texas A&M University Fall 2011 Lists Ordered collection of data.

More information

CS112 Spring 2012 Dr. Kinga Dobolyi. Exam 2. Do not open this exam until you are told. Read these instructions:

CS112 Spring 2012 Dr. Kinga Dobolyi. Exam 2. Do not open this exam until you are told. Read these instructions: CS112 Spring 2012 Dr. Kinga Dobolyi Exam 2 Do not open this exam until you are told. Read these instructions: 1. This is a closed book exam. No calculators, notes, or other aids are allowed. If you have

More information

CMPSCI 119 LAB #3 Fish Tank Professor William T. Verts

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

More information

S206E Lecture 23, 5/26/2016, Interaction between Python and Grasshopper

S206E Lecture 23, 5/26/2016, Interaction between Python and Grasshopper S206E057 -- Lecture 23, 5/26/2016, Interaction between Python and Grasshopper Copyright 2016, Chiu-Shui Chan. All Rights Reserved. S206E057 Spring 2016 This lecture covers the techniques of using rhinoscriptsyntax

More information

CMPSCI 119 Spring 2015 Wednesday, April 1, 2015 Midterm #2 Solution Key Professor William T. Verts

CMPSCI 119 Spring 2015 Wednesday, April 1, 2015 Midterm #2 Solution Key Professor William T. Verts CMPSCI 119 Spring 2015 Wednesday, April 1, 2015 Midterm #2 Solution Key Professor William T. Verts 20 Points Modify the following code to use for-loops instead of while-loops. Use as few Python statements

More information

Calculators ARE NOT Permitted On This Portion Of The Exam 28 Questions - 55 Minutes

Calculators ARE NOT Permitted On This Portion Of The Exam 28 Questions - 55 Minutes 1 of 11 1) Give f(g(1)), given that Calculators ARE NOT Permitted On This Portion Of The Exam 28 Questions - 55 Minutes 2) Find the slope of the tangent line to the graph of f at x = 4, given that 3) Determine

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

PyPlot. The plotting library must be imported, and we will assume in these examples an import statement similar to those for numpy and math as

PyPlot. The plotting library must be imported, and we will assume in these examples an import statement similar to those for numpy and math as Geog 271 Geographic Data Analysis Fall 2015 PyPlot Graphicscanbeproducedin Pythonviaavarietyofpackages. We willuseapythonplotting package that is part of MatPlotLib, for which documentation can be found

More information

Exam 2, Form A CSE 231 Spring 2014 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Exam 2, Form A CSE 231 Spring 2014 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN. Name: Section: Date: INSTRUCTIONS: (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN. (2) This exam booklet contains 30 questions, each of which will be weighted equally at 5 points each.

More information

Exam 2, Form B CSE 231 Spring 2014 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Exam 2, Form B CSE 231 Spring 2014 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN. Name: Section: Date: INSTRUCTIONS: (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN. (2) This exam booklet contains 30 questions, each of which will be weighted equally at 5 points each.

More information

CSC 108H1 F 2010 Test 1 Duration 45 minutes Aids allowed: none. Student Number:

CSC 108H1 F 2010 Test 1 Duration 45 minutes Aids allowed: none. Student Number: CSC 108H1 F 2010 Test 1 Duration 45 minutes Aids allowed: none Last Name: Lecture Section: L0101 Student Number: First Name: Instructors: Horton and Engels Do not turn this page until you have received

More information

3-D Shapes and volume

3-D Shapes and volume 3-D Shapes and Volume Question Paper 1 Level IGCSE Subject Maths Exam Board Edexcel Topic Shape, Space and Measures Sub Topic 3-D Shapes and volume Booklet Question Paper 1 Time Allowed: 57 minutes Score:

More information

AGI Manual for ACT-R Working Draft. Dan Bothell

AGI Manual for ACT-R Working Draft. Dan Bothell AGI Manual for ACT-R 7.6 + Working Draft Dan Bothell Table of Contents Table of Contents...2 Introduction...3 Background...4 Devices...4 Virtual Windows...4 Visible Virtual Windows...4 UWI...4 Older ACT-R

More information

A. 180 B. 108 C. 360 D. 540

A. 180 B. 108 C. 360 D. 540 Part I - Multiple Choice - Circle your answer: REVIEW FOR FINAL EXAM - GEOMETRY 2 1. Find the area of the shaded sector. Q O 8 P A. 2 π B. 4 π C. 8 π D. 16 π 2. An octagon has sides. A. five B. six C.

More information

mith College Computer Science CSC103 How Computers Work Week 7 Fall 2017 Dominique Thiébaut

mith College Computer Science CSC103 How Computers Work Week 7 Fall 2017 Dominique Thiébaut mith College Computer Science CSC103 How Computers Work Week 7 Fall 2017 Dominique Thiébaut dthiebaut@smith.edu Important Review Does the animation leave a trace? Are the moving objects move without a

More information

PyPlot. The plotting library must be imported, and we will assume in these examples an import statement similar to those for numpy and math as

PyPlot. The plotting library must be imported, and we will assume in these examples an import statement similar to those for numpy and math as Geog 271 Geographic Data Analysis Fall 2017 PyPlot Graphicscanbeproducedin Pythonviaavarietyofpackages. We willuseapythonplotting package that is part of MatPlotLib, for which documentation can be found

More information

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu) I. INTERACTIVE MODE VERSUS SCRIPT MODE There are two ways to use the python interpreter: interactive mode and script mode. 1. Interactive Mode (a) open a terminal shell (terminal emulator in Applications

More information

Review. Input, Processing and Output. Review. Review. Designing a Program. Typical Software Development cycle. Bonita Sharif

Review. Input, Processing and Output. Review. Review. Designing a Program. Typical Software Development cycle. Bonita Sharif Input, Processing and Output Bonita Sharif 1 Review A program is a set of instructions a computer follows to perform a task The CPU is responsible for running and executing programs A set of instructions

More information

Remaining Enhanced Labs

Remaining Enhanced Labs Here are some announcements regarding the end of the semester, and the specifications for the last Enhanced Labs. Don t forget that you need to take the Common Final Examination on Saturday, May 5, from

More information

Math 124 Final Examination Winter 2016 !!! READ...INSTRUCTIONS...READ!!!

Math 124 Final Examination Winter 2016 !!! READ...INSTRUCTIONS...READ!!! Math 124 Final Examination Winter 2016 Print Your Name Signature Student ID Number Quiz Section Professor s Name TA s Name!!! READ...INSTRUCTIONS...READ!!! 1. Your exam contains 7 problems and 9 pages;

More information

CAS London CPD Day February 16

CAS London CPD Day February 16 Practical Sheet: GUI Programming This sheet is a set of exercises for introducing GUI programming in Python using Tkinter, assuming knowledge of basic Python programming. All materials are at http://www.eecs.qmul.ac.uk/~william/cas-london-2016.html

More information

Programming Languages & Translators. XML Document Manipulation Language (XDML) Language Reference Manual

Programming Languages & Translators. XML Document Manipulation Language (XDML) Language Reference Manual Programming Languages & Translators (COMS W4115) Department of Computer Science Columbia University Summer 2007 XML Document Manipulation Language (XDML) Language Reference Manual Luba Leyzerenok ll2310@columbia.edu

More information

Chapter 3: Introduction to MATLAB Programming (4 th ed.)

Chapter 3: Introduction to MATLAB Programming (4 th ed.) Chapter 3: Introduction to MATLAB Programming (4 th ed.) Algorithms MATLAB scripts Input / Output o disp versus fprintf Graphs Read and write variables (.mat files) User-defined Functions o Definition

More information

Basic Operations and Equivalent Expressions - Step-by-Step Lesson

Basic Operations and Equivalent Expressions - Step-by-Step Lesson Name Date Basic Operations and Equivalent Expressions StepbyStep Lesson Lesson 1 Simplify the expressions. 1. 4 (6x 5) 2. 3 (4 3 7x) Explanation: 1. Step 1) First see what is being asked. We have to simplify

More information

VARIABLES Storing numbers:

VARIABLES Storing numbers: VARIABLES Storing numbers: You may create and use variables in Matlab to store data. There are a few rules on naming variables though: (1) Variables must begin with a letter and can be followed with any

More information

Mathematics Class 10 Board Sample paper-1

Mathematics Class 10 Board Sample paper-1 1 Mathematics Class 10 Board Sample paper-1 Time allowed: 3 hours Maximum Marks: 80 General Instructions: a) All questions are compulsory. b) The question paper consists of 30 questions divided into four

More information

WHAT ARE THE PARTS OF A QUADRATIC?

WHAT ARE THE PARTS OF A QUADRATIC? 4.1 Introduction to Quadratics and their Graphs Standard Form of a Quadratic: y ax bx c or f x ax bx c. ex. y x. Every function/graph in the Quadratic family originates from the parent function: While

More information

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu) I. INTERACTIVE MODE VERSUS SCRIPT MODE There are two ways to use the python interpreter: interactive mode and script mode. 1. Interactive Mode (a) open a terminal shell (terminal emulator in Applications

More information

Chapter 2 (Part 2) MATLAB Basics. dr.dcd.h CS 101 /SJC 5th Edition 1

Chapter 2 (Part 2) MATLAB Basics. dr.dcd.h CS 101 /SJC 5th Edition 1 Chapter 2 (Part 2) MATLAB Basics dr.dcd.h CS 101 /SJC 5th Edition 1 Display Format In the command window, integers are always displayed as integers Characters are always displayed as strings Other values

More information