Problem 1. Multiple Choice (choose only one answer)

Size: px
Start display at page:

Download "Problem 1. Multiple Choice (choose only one answer)"

Transcription

1 Practice problems for the Final (Tuesday, May 14 4:30-6:30pm MHP 101). The Final Exam will cover all course material. You will be expected to know the material from the assigned readings in the book, the in- class activities, lectures, problem sets, labs and the homework. Exams are closed book. Format of the Final Problem 1. Multiple Choice Problem 2. What does this code do? Problem 3. Debug this code Problem 4. Recursion Problem 5. Problem Solving Problem 1. Multiple Choice (choose only one answer) 1. Why is Big O important? a) Big- O notation is a measure of the order of magnitude, or complexity, of an algorithm. b) It shows the function will perform with respect to the size of its input. c) because it compare algorithms, and evaluates how efficient they are. d) it gives us a guarantee on when the algorithm will end 2. Why do computer scientists know binary? a) The computer memory is transistors that store high or low voltage b) 0 represents low voltage, 1 is high voltage c) computer memory is a collection of binary strings d) commonly used to represent memory address 3.Why use pointers? a) Share access to one copy of data b) efficiency in time and memory for passing parameters c) dynamic data structures d) precise control of allocation/deallocation 4.Why would you want to dynamically allocate memory? a) efficiency in memory management on the stack b) allocate data structure of specific size at run time c) the allocated memory can persist on the stack after a function executes d) the heap is full

2 Problem 2. What does this code do? Given this function definition: int mystery(int a[],int b, int c, int X) { int m = (b + c) /2; if(b > c) return - 1; if(a[m] == X) return m; if(a[m] > X) return mystery(a,b,m- 1,X); else return mystery(a,m+1c,x); And given this declaration: int numbers[10] = {1,26, 47,54, 59,80, 87,91, 105, 340 What would this function call return: mystery(numbers,0,10,106); How many recursive calls would be made? Problem 3. Debug this Code The Big O for the BubbleSort algorithm is O(n 2 ). You want to use BubbleSort to handle sorting lists of numbers that are already nearly sorted. Update the code below to optimize the Big O. void BubbleSort(int numbers[], int size) { for(int i=0; i < size-1; i++) { for(int j=0; j < size-1; j++) { if(numbers[j] > numbers[j+1]) { swap(numbers[j],numbers[j+1]);

3 Problem 4. Recursion 1. Write a recursive function called Star(int n) which will print the following when n=4: 2. Write a recursive function to compute the logarithm of base 2 of n. 3. Write a function to reverse a vector of integers using recursion. 4. Write a recursive function called Star which will print the following when n=5:

4 Problem 5. Problem Solving Given the following class and struct definitions: //struct Pixel holds the red, green, and blue values for //one pixel for an image matrix. As unsigned char //variables, R, G, B have 8 bits of memory. struct Pixel { unsigned char R; //Red value unsigned char G; //Green value unsigned char B; //Blue value ; //class Picture creates, manipulates, and maintains a image //matrix of pixels class Picture { ; public: Picture(); //Constructor Picture(int wid, int ht); //constructs matrix of Pixel ~Picture(); //Destructor void show();//prints out a matrix of Pixels // returns RGB value of a pixel in the matrix at (y,x) int getpixelcolor(int x, int y); //sets the RGB values of pixel in the matrix at (y,x) //R,G,B as integers take input in decimal void setpixelcolor(int x, int y, int R, int G, int B); int getheight(); //returns height of image int getwidth(); //returns width of image private: Pixel image_data; // 2d matrix of pixels int width; //width of image matrix int height; //height of image matrix

5 1. Write a program to draw a black border on a Picture object, given a pointer to a Picture object as an input parameter. 2. Write a program that draws the Fibonacci Spiral of size N on a Picture object, given N and a pointer to a Picture object as an input parameter. 3. Write a program that draws a Sierpinski Triangle of size N on a Picture object, given N and a pointer to a Picture object as an input parameter. 4. Write a function that takes a pointer to a Picture object as an input parameter. The function then changes the pixel color of picture object for the pixels shown below in the case of width = 10 and height = 10. The function should draw a red X on the picture with the first diagonal starting at 0,0 and with the second diagonal starting at 0, width- 1. The red pixel color is R=0xFF, G=0x9, B=0x0. Note: this function should work for all values of width and height. HEIGHT WIDTH x y

6 5. Obstacles in the path of a robot can be detected using the IR sensors in front of the robot. Then, based on the values obtained, the robot can decide to turn away from an approaching obstacle using the following algorithm: if obstacle straight ahead, turn (chose left or right?) if obstacle on left, turn right if obstacle on right, turn left otherwise cruise Write a program for your robot to display this type of obstacle avoidance behavior 6. Refrigerator Detective: Build a refrigerator detective robot that sits inside the fridge and tells you if the light is on or off! Write a program for your robot to return TRUE if light on or FALSE otherwise. 7. Burglar Alarm Robot: Design a robot that sits in front of your dorm door. As soon as the door opens out into the hallway, it sounds an alarm (beeps). Write a program for your robot to display this type of behavior and takes as input the frequency of the beep the robot will sound in an alarm.

Midterm Exam #2 Spring (1:00-3:00pm, Friday, March 15)

Midterm Exam #2 Spring (1:00-3:00pm, Friday, March 15) Print Your Name: Signature: USC email address: CSCI 101L Fundamentals of Computer Programming Midterm Exam #2 Spring 2013 (1:00-3:00pm, Friday, March 15) Instructor: Prof Tejada Problem #1 (20 points):

More information

MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm.

MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm. MCS 2514 Fall 2012 Programming Assignment 3 Image Processing Pointers, Class & Dynamic Data Due: Nov 25, 11:59 pm. This project is called Image Processing which will shrink an input image, convert a color

More information

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive)

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive) Final Exam Exercises CS 2308 Spring 2014 Jill Seaman Chapters 1-7 + 11 Write C++ code to: Determine if a number is odd or even Determine if a number/character is in a range - 1 to 10 (inclusive) - between

More information

Common Misunderstandings from Exam 1 Material

Common Misunderstandings from Exam 1 Material Common Misunderstandings from Exam 1 Material Kyle Dewey Stack and Heap Allocation with Pointers char c = c ; char* p1 = malloc(sizeof(char)); char** p2 = &p1; Where is c allocated? Where is p1 itself

More information

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators) Name: Email address: Quiz Section: CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators) Instructions: Read the directions for each question carefully before answering. We will

More information

CSCI-1200 Data Structures Fall 2017 Lecture 7 Order Notation & Basic Recursion

CSCI-1200 Data Structures Fall 2017 Lecture 7 Order Notation & Basic Recursion CSCI-1200 Data Structures Fall 2017 Lecture 7 Order Notation & Basic Recursion Announcements: Test 1 Information Test 1 will be held Monday, Sept 25th, 2017 from 6-7:50pm Students will be randomly assigned

More information

l Determine if a number is odd or even l Determine if a number/character is in a range - 1 to 10 (inclusive) - between a and z (inclusive)

l Determine if a number is odd or even l Determine if a number/character is in a range - 1 to 10 (inclusive) - between a and z (inclusive) Final Exam Exercises Chapters 1-7 + 11 Write C++ code to: l Determine if a number is odd or even CS 2308 Fall 2016 Jill Seaman l Determine if a number/character is in a range - 1 to 10 (inclusive) - between

More information

RECURSION (CONTINUED)

RECURSION (CONTINUED) RECURSION (CONTINUED) Lecture 9 CS2110 Fall 2017 Prelim one week from Thursday 1. Visit Exams page of course website, check what time your prelim is, complete assignment P1Conflict ONLY if necessary. So

More information

CSE030 Fall 2012 Final Exam Friday, December 14, PM

CSE030 Fall 2012 Final Exam Friday, December 14, PM CSE030 Fall 2012 Final Exam Friday, December 14, 2012 3-6PM Write your name here and at the top of each page! Name: Select your lab session: Tuesdays Thursdays Paper. If you have any questions or need

More information

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers) Review Final exam Final exam will be 12 problems, drop any 2 Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers) 2 hours exam time, so 12 min per problem (midterm 2 had

More information

RECURSION (CONTINUED)

RECURSION (CONTINUED) RECURSION (CONTINUED) Lecture 9 CS2110 Spring 2018 Prelim two weeks from today: 13 March. 1. Visit Exams page of course website, check what time your prelim is, complete assignment P1Conflict ONLY if necessary.

More information

Exam I Review Questions Fall 2010

Exam I Review Questions Fall 2010 Exam I Review Questions Fall 2010 The following review questions are similar to the kinds of questions you will be expected to answer on Exam I (scheduled for Oct. 14), which will cover LCR, chs. 1 7,

More information

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR STUDENT IDENTIFICATION NO MULTIMEDIA COLLEGE JALAN GURNEY KIRI 54100 KUALA LUMPUR FIFTH SEMESTER FINAL EXAMINATION, 2014/2015 SESSION PSD2023 ALGORITHM & DATA STRUCTURE DSEW-E-F-2/13 25 MAY 2015 9.00 AM

More information

CS250 Final Review Questions

CS250 Final Review Questions CS250 Final Review Questions The following is a list of review questions that you can use to study for the final. I would first make sure that you review all previous exams and make sure you fully understand

More information

QUIZ How do we implement run-time constants and. compile-time constants inside classes?

QUIZ How do we implement run-time constants and. compile-time constants inside classes? QUIZ How do we implement run-time constants and compile-time constants inside classes? Compile-time constants in classes The static keyword inside a class means there s only one instance, regardless of

More information

Announcements. Lecture 04b Header Classes. Review (again) Comments on PA1 & PA2. Warning about Arrays. Arrays 9/15/17

Announcements. Lecture 04b Header Classes. Review (again) Comments on PA1 & PA2. Warning about Arrays. Arrays 9/15/17 Announcements Lecture 04b Sept. 14 th, 2017 Midterm #1: Sept. 26 th (week from Tuesday) Code distributed one week from today PA2 test cases & answers posted Quiz #4 next Tuesday (before class) PA3 due

More information

University of Illinois at Urbana-Champaign Department of Computer Science. First Examination

University of Illinois at Urbana-Champaign Department of Computer Science. First Examination University of Illinois at Urbana-Champaign Department of Computer Science First Examination CS 225 Data Structures and Software Principles Summer 2005 3:00pm 4:15pm Tuesday, July 5 Name: NetID: Lab Section

More information

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger.

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger. UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division CS61B Fall 2015 P. N. Hilfinger Test #2 READ THIS PAGE FIRST. Please do not discuss this exam

More information

CSCI-1200 Data Structures Spring 2018 Lecture 7 Order Notation & Basic Recursion

CSCI-1200 Data Structures Spring 2018 Lecture 7 Order Notation & Basic Recursion CSCI-1200 Data Structures Spring 2018 Lecture 7 Order Notation & Basic Recursion Review from Lectures 5 & 6 Arrays and pointers, Pointer arithmetic and dereferencing, Types of memory ( automatic, static,

More information

! Determine if a number is odd or even. ! Determine if a number/character is in a range. ! Assign a category based on ranges (wind speed)

! Determine if a number is odd or even. ! Determine if a number/character is in a range. ! Assign a category based on ranges (wind speed) Final Exam Exercises Chapters 1-7 + 11 Write C++ code to:! Determine if a number is odd or even CS 2308 Spring 2013 Jill Seaman! Determine if a number/character is in a range - 1 to 10 (inclusive) - between

More information

MCS 360 Exam 2 11 November In order to get full credit, you need to show your work.

MCS 360 Exam 2 11 November In order to get full credit, you need to show your work. MCS 360 Exam 2 11 November 2015 Name: Do not start until instructed to do so. In order to get full credit, you need to show your work. You have 50 minutes to complete the exam. Good Luck! Problem 1.a /15

More information

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 Instructor: K. S. Booth Time: 70 minutes (one hour ten minutes)

More information

Two Types of Types. Primitive Types in Java. Using Primitive Variables. Class #07: Java Primitives. Integer types.

Two Types of Types. Primitive Types in Java. Using Primitive Variables. Class #07: Java Primitives. Integer types. Class #07: Java Primitives Software Design I (CS 120): M. Allen, 13 Sep. 2018 Two Types of Types So far, we have mainly been dealing with objects, like DrawingGizmo, Window, Triangle, that are: 1. Specified

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques () Lecture 13 February 12, 2018 Mutable State & Abstract Stack Machine Chapters 14 &15 Homework 4 Announcements due on February 20. Out this morning Midterm results

More information

CSE 332 Autumn 2013: Midterm Exam (closed book, closed notes, no calculators)

CSE 332 Autumn 2013: Midterm Exam (closed book, closed notes, no calculators) Name: Email address: Quiz Section: CSE 332 Autumn 2013: Midterm Exam (closed book, closed notes, no calculators) Instructions: Read the directions for each question carefully before answering. We will

More information

CGS 2405 Advanced Programming with C++ Course Justification

CGS 2405 Advanced Programming with C++ Course Justification Course Justification This course is the second C++ computer programming course in the Computer Science Associate in Arts degree program. This course is required for an Associate in Arts Computer Science

More information

Data Structure and Algorithm, Spring 2013 Midterm Examination 120 points Time: 2:20pm-5:20pm (180 minutes), Tuesday, April 16, 2013

Data Structure and Algorithm, Spring 2013 Midterm Examination 120 points Time: 2:20pm-5:20pm (180 minutes), Tuesday, April 16, 2013 Data Structure and Algorithm, Spring 2013 Midterm Examination 120 points Time: 2:20pm-5:20pm (180 minutes), Tuesday, April 16, 2013 Problem 1. In each of the following question, please specify if the statement

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

(SSOL) Simple Shape Oriented Language

(SSOL) Simple Shape Oriented Language (SSOL) Simple Shape Oriented Language Madeleine Tipp Jeevan Farias Daniel Mesko mrt2148 jtf2126 dpm2153 Description: SSOL is a programming language that simplifies the process of drawing shapes to SVG

More information

CS 61B Summer 2005 (Porter) Midterm 2 July 21, SOLUTIONS. Do not open until told to begin

CS 61B Summer 2005 (Porter) Midterm 2 July 21, SOLUTIONS. Do not open until told to begin CS 61B Summer 2005 (Porter) Midterm 2 July 21, 2005 - SOLUTIONS Do not open until told to begin This exam is CLOSED BOOK, but you may use 1 letter-sized page of notes that you have created. Problem 0:

More information

CS 1316 Exam 1 Summer 2009

CS 1316 Exam 1 Summer 2009 1 / 8 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 1316 Exam 1 Summer 2009 Section/Problem

More information

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive)

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive) Final Exam Exercises Chapters 1-7 + 11 Write C++ code to:! Determine if a number is odd or even CS 2308 Fall 2018 Jill Seaman! Determine if a number/character is in a range - 1 to 10 (inclusive) - between

More information

Computer Science II Data Structures

Computer Science II Data Structures Computer Science II Data Structures Instructor Sukumar Ghosh 201P Maclean Hall Office hours: 10:30 AM 12:00 PM Mondays and Fridays Course Webpage homepage.cs.uiowa.edu/~ghosh/2116.html Course Syllabus

More information

CS250 Final Review Questions

CS250 Final Review Questions CS250 Final Review Questions The following is a list of review questions that you can use to study for the final. I would first make sure you review all previous exams and make sure you fully understand

More information

CS32 Final Exam. E03, F15, Phill Conrad, UC Santa Barbara

CS32 Final Exam. E03, F15, Phill Conrad, UC Santa Barbara 1 #1 Page: 1 Name: CS32 Final E03, F15, Phill Conrad, UC Santa Barbara Thursday, 12/10/2015, noon 3pm Name: Umail Address: @ umail.ucsb.edu Please write your name above AND AT THE TOP OF EVERY PAGE Be

More information

CS 132 Exam #1 - Study Suggestions

CS 132 Exam #1 - Study Suggestions CS 132 - Exam #1 Study Suggestions p. 1 * last modified: 2-16-05 CS 132 Exam #1 - Study Suggestions * The test covers through HW #3, the Week 5 Lab Exercise Exercise, and material through the 2-14-05 lecture/2-16-05

More information

CSCE 2014 Final Exam Spring Version A

CSCE 2014 Final Exam Spring Version A CSCE 2014 Final Exam Spring 2017 Version A Student Name: Student UAID: Instructions: This is a two-hour exam. Students are allowed one 8.5 by 11 page of study notes. Calculators, cell phones and computers

More information

Lecture 3: C Programm

Lecture 3: C Programm 0 3 E CS 1 Lecture 3: C Programm ing Reading Quiz Note the intimidating red border! 2 A variable is: A. an area in memory that is reserved at run time to hold a value of particular type B. an area in memory

More information

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018 CSCE 20/220 Data Structures and Algorithms Prof. Amr Goneid Fall 208 CSCE 20/220 DATA STRUCTURES AND ALGORITHMS Dr. Amr Goneid Course Goals To introduce concepts of Data Models, Data Abstraction and ADTs

More information

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully.

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully. UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING FINAL EXAMINATION, APRIL 2017 CSC 190 HIS - COMPUTER ALGORITHMS AND DATA STRUCTURES Exam Type: A NO calculator allowed Duration: 2.5 hours

More information

CS 2150 Final Exam, Spring 2018 Page 1 of 10 UVa userid:

CS 2150 Final Exam, Spring 2018 Page 1 of 10 UVa userid: CS 2150 Final Exam, Spring 2018 Page 1 of 10 UVa userid: CS 2150 Final Exam Name You MUST write your e-mail ID on EACH page and put your name on the top of this page, too. If you are still writing when

More information

CS 177 Week 15 Recitation Slides. Review

CS 177 Week 15 Recitation Slides. Review CS 177 Week 15 Recitation Slides Review 1 Announcements Final Exam on Friday Dec. 18 th STEW 183 from 1 3 PM Complete your online review of your classes. Your opinion matters!!! Project 6 due Just kidding

More information

CS112 Lecture: Working with Numbers

CS112 Lecture: Working with Numbers CS112 Lecture: Working with Numbers Last revised January 30, 2008 Objectives: 1. To introduce arithmetic operators and expressions 2. To expand on accessor methods 3. To expand on variables, declarations

More information

CSE373 Fall 2013, Midterm Examination October 18, 2013

CSE373 Fall 2013, Midterm Examination October 18, 2013 CSE373 Fall 2013, Midterm Examination October 18, 2013 Please do not turn the page until the bell rings. Rules: The exam is closed-book, closed-note, closed calculator, closed electronics. Please stop

More information

Searching for Information. A Simple Method for Searching. Simple Searching. Class #21: Searching/Sorting I

Searching for Information. A Simple Method for Searching. Simple Searching. Class #21: Searching/Sorting I Class #21: Searching/Sorting I Software Design II (CS 220): M. Allen, 26 Feb. 18 Searching for Information Many applications involve finding pieces of information Finding a book in a library or store catalogue

More information

Name: Username: I. 20. Section: II. p p p III. p p p p Total 100. CMSC 202 Section 06 Fall 2015

Name: Username: I. 20. Section: II. p p p III. p p p p Total 100. CMSC 202 Section 06 Fall 2015 CMSC 202 Section 06 Fall 2015 Computer Science II Midterm Exam I Name: Username: Score Max Section: (check one) 07 - Sushant Athley, Tuesday 11:30am 08 - Aishwarya Bhide, Thursday 11:30am 09 - Phanindra

More information

CS 112 Final May 8, 2008 (Lightly edited for 2012 Practice) Name: BU ID: Instructions

CS 112 Final May 8, 2008 (Lightly edited for 2012 Practice) Name: BU ID: Instructions CS 112 Final May 8, 2008 (Lightly edited for 2012 Practice) Name: BU ID: This exam is CLOSED book and notes. Instructions The exam consists of six questions on 11 pages. Please answer all questions on

More information

CSE 373 Spring 2010: Midterm #1 (closed book, closed notes, NO calculators allowed)

CSE 373 Spring 2010: Midterm #1 (closed book, closed notes, NO calculators allowed) Name: Email address: CSE 373 Spring 2010: Midterm #1 (closed book, closed notes, NO calculators allowed) Instructions: Read the directions for each question carefully before answering. We may give partial

More information

Chapter 3. Texture mapping. Learning Goals: Assignment Lab 3: Implement a single program, which fulfills the requirements:

Chapter 3. Texture mapping. Learning Goals: Assignment Lab 3: Implement a single program, which fulfills the requirements: Chapter 3 Texture mapping Learning Goals: 1. To understand texture mapping mechanisms in VRT 2. To import external textures and to create new textures 3. To manipulate and interact with textures 4. To

More information

FORM 2 (Please put your name and form # on the scantron!!!!) CS 161 Exam II:

FORM 2 (Please put your name and form # on the scantron!!!!) CS 161 Exam II: FORM 2 (Please put your name and form # on the scantron!!!!) CS 161 Exam II: True (A)/False(B) (2 pts each): 1. The declaration below declares three pointer variables of type pointer to double that is

More information

Code No: R Set No. 1

Code No: R Set No. 1 Code No: R05010106 Set No. 1 1. (a) Draw a Flowchart for the following The average score for 3 tests has to be greater than 80 for a candidate to qualify for the interview. Representing the conditional

More information

Introduction To C#.NET

Introduction To C#.NET Introduction To C#.NET Microsoft.Net was formerly known as Next Generation Windows Services(NGWS).It is a completely new platform for developing the next generation of windows/web applications. However

More information

Practice Midterm Exam #1

Practice Midterm Exam #1 Eric Roberts Handout #23 CS106B January 28, 2013 Practice Midterm Exam #1 Review session: Sunday, February 3, 7:00 9:00 P.M., Hewlett 201 (next door) Midterm #1: Tuesday, February 5, 3:15 5:15 P.M., Braun

More information

More on Arrays CS 16: Solving Problems with Computers I Lecture #13

More on Arrays CS 16: Solving Problems with Computers I Lecture #13 More on Arrays CS 16: Solving Problems with Computers I Lecture #13 Ziad Matni Dept. of Computer Science, UCSB Announcements Homework #12 due today No homework assigned today!! Lab #7 is due on Monday,

More information

CPSC 211, Sections : Data Structures and Implementations, Honors Final Exam May 4, 2001

CPSC 211, Sections : Data Structures and Implementations, Honors Final Exam May 4, 2001 CPSC 211, Sections 201 203: Data Structures and Implementations, Honors Final Exam May 4, 2001 Name: Section: Instructions: 1. This is a closed book exam. Do not use any notes or books. Do not confer with

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

For Teacher's Use Only Q No Total Q No Q No

For Teacher's Use Only Q No Total Q No Q No Student Info Student ID: Center: Exam Date: FINALTERM EXAMINATION Spring 2010 CS201- Introduction to Programming Time: 90 min Marks: 58 For Teacher's Use Only Q No. 1 2 3 4 5 6 7 8 Total Marks Q No. 9

More information

EL2310 Scientific Programming

EL2310 Scientific Programming Lecture 12: Memory, Files and Bitoperations (pronobis@kth.se) Overview Overview Lecture 12: Memory, Files and Bit operations Wrap Up Main function; reading and writing Bitwise Operations Wrap Up Lecture

More information

EEL 3801 Introduction to Computer Engineering Summer Home Work Schedule

EEL 3801 Introduction to Computer Engineering Summer Home Work Schedule EEL 3801 Introduction to Computer Engineering Summer 2005 Home Work Schedule Schedule of Assignments: Week HW# Due Points Title 1 07/05/05 3% Memory dump in assembly 2 07/19/05 3% Solve a Maze 3 08/02/05

More information

CSE 8A Lecture 13. Reading for next class: Today s topics: Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Friday. Sounds!

CSE 8A Lecture 13. Reading for next class: Today s topics: Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Friday. Sounds! CSE 8A Lecture 13 Reading for next class: 8.4-8.5 Today s topics: Sounds! Finish PSA 6: Chromakey! DUE TUESDAY Interm exam 3 next Friday CSE 8a Exam #3 Study Hints 1) Reading Quizzes (2/4-2/15) Omit 2/6/13

More information

Final Examination CS 125 Introduction to Computer Science Fall Hours

Final Examination CS 125 Introduction to Computer Science Fall Hours University of Illinois at Urbana-Champaign Department of Computer Science Final Examination CS 125 Introduction to Computer Science Fall 2009 3 Hours Last Name: First Name: NetID: @ illinois.edu PLEASE

More information

Algorithmic Analysis. Go go Big O(h)!

Algorithmic Analysis. Go go Big O(h)! Algorithmic Analysis Go go Big O(h)! 1 Corresponding Book Sections Pearson: Chapter 6, Sections 1-3 Data Structures: 4.1-4.2.5 2 What is an Algorithm? Informally, any well defined computational procedure

More information

ESC101 : Fundamental of Computing

ESC101 : Fundamental of Computing ESC101 : Fundamental of Computing End Semester Exam 19 November 2008 Name : Roll No. : Section : Note : Read the instructions carefully 1. You will lose 3 marks if you forget to write your name, roll number,

More information

CIS 110 Introduction to Computer Programming Summer 2014 Final. Name:

CIS 110 Introduction to Computer Programming Summer 2014 Final. Name: CIS 110 Introduction to Computer Programming Summer 2014 Final Name: PennKey (e.g., bhusnur4): My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity

More information

: Principles of Imperative Computation Victor Adamchik. Practice Exam - I

: Principles of Imperative Computation Victor Adamchik. Practice Exam - I 15-122 Practice Exam - I Page 1 of 10 15-122 : Principles of Imperative Computation Victor Adamchik Practice Exam - I Name: Andrew ID: Answer the questions in the space provided following each question.

More information

Esc101 Mid Semester Exam - II

Esc101 Mid Semester Exam - II Esc101 Mid Semester Exam - II Time Allowed: 1 Hour Max Marks: 75 Instructions: 1. Do not turn this page until the bell rings. 2. YOU MUST WRITE YOUR NAME, ROLL NUMBER & SECTION ON EACH SHEET. 3. Please

More information

CSE 143. Complexity Analysis. Program Efficiency. Constant Time Statements. Big Oh notation. Analyzing Loops. Constant Time Statements (2) CSE 143 1

CSE 143. Complexity Analysis. Program Efficiency. Constant Time Statements. Big Oh notation. Analyzing Loops. Constant Time Statements (2) CSE 143 1 CSE 1 Complexity Analysis Program Efficiency [Sections 12.1-12., 12., 12.9] Count number of instructions executed by program on inputs of a given size Express run time as a function of the input size Assume

More information

UW CSE 351, Winter 2013 Final Exam

UW CSE 351, Winter 2013 Final Exam Full Name: Student ID #: UW CSE 351, Winter 2013 Final Exam March 20, 2013 2:30pm - 4:20pm Instructions: Write your full name and UW student ID number on the front of the exam. When the exam begins, make

More information

Highlights. - Making threads. - Waiting for threads. - Review (classes, pointers, inheritance)

Highlights. - Making threads. - Waiting for threads. - Review (classes, pointers, inheritance) Parallel processing Highlights - Making threads - Waiting for threads - Review (classes, pointers, inheritance) Review: CPUs Review: CPUs In the 2000s, computing too a major turn: multi-core processors

More information

Lecture Notes on Memory Layout

Lecture Notes on Memory Layout Lecture Notes on Memory Layout 15-122: Principles of Imperative Computation Frank Pfenning André Platzer Lecture 11 1 Introduction In order to understand how programs work, we can consider the functions,

More information

CS302 Data Structures using C++

CS302 Data Structures using C++ CS302 Data Structures using C++ Study Guide for the Final Exam Fall 2018 Revision 1.1 This document serves to help you prepare towards the final exam for the Fall 2018 semester. 1. What topics are to be

More information

blur Melissa Kaufman-Gomez Team Leader Timothy Goodwin System Architect Dexter Callender Language Guru Daniel Hong Test Wizard

blur Melissa Kaufman-Gomez Team Leader Timothy Goodwin System Architect Dexter Callender Language Guru Daniel Hong Test Wizard blur Melissa Kaufman-Gomez Team Leader Timothy Goodwin System Architect Dexter Callender Language Guru Daniel Hong Test Wizard blur : -noun. a programming language for creating and modifying ASCII art.

More information

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2017 EXAMINATIONS CSC 104 H1S Instructor(s): G. Baumgartner Duration 3 hours PLEASE HAND IN No Aids Allowed Student Number: Last (Family)

More information

Week 8: Operator overloading

Week 8: Operator overloading Due to various disruptions, we did not get through all the material in the slides below. CS319: Scientific Computing (with C++) Week 8: Operator overloading 1 The copy constructor 2 Operator Overloading

More information

CS 216 Exam 1 Fall SOLUTION

CS 216 Exam 1 Fall SOLUTION CS 216 Exam 1 Fall 2004 - SOLUTION Name: Lab Section: Email Address: Student ID # This exam is closed note, closed book. You will have an hour and fifty minutes total to complete the exam. You may NOT

More information

Learning Recursion. Recursion [ Why is it important?] ~7 easy marks in Exam Paper. Step 1. Understand Code. Step 2. Understand Execution

Learning Recursion. Recursion [ Why is it important?] ~7 easy marks in Exam Paper. Step 1. Understand Code. Step 2. Understand Execution Recursion [ Why is it important?] ~7 easy marks in Exam Paper Seemingly Different Coding Approach In Fact: Strengthen Top-down Thinking Get Mature in - Setting parameters - Function calls - return + work

More information

Example Final Questions Instructions

Example Final Questions Instructions Example Final Questions Instructions This exam paper contains a set of sample final exam questions. It is for practice purposes only. You ll most likely need longer than three hours to answer all the questions.

More information

ECE 250 / CS 250 Computer Architecture. C to Binary: Memory & Data Representations. Benjamin Lee

ECE 250 / CS 250 Computer Architecture. C to Binary: Memory & Data Representations. Benjamin Lee ECE 250 / CS 250 Computer Architecture C to Binary: Memory & Data Representations Benjamin Lee Slides based on those from Alvin Lebeck, Daniel Sorin, Andrew Hilton, Amir Roth, Gershon Kedem Administrivia

More information

CS 223: Data Structures and Programming Techniques. Exam 2

CS 223: Data Structures and Programming Techniques. Exam 2 CS 223: Data Structures and Programming Techniques. Exam 2 Instructor: Jim Aspnes Work alone. Do not use any notes or books. You have approximately 75 minutes to complete this exam. Please write your answers

More information

Recursion. Example R1

Recursion. Example R1 Recursion Certain computer problems are solved by repeating the execution of one or more statements a certain number of times. So far, we have implemented the repetition of one or more statements by using

More information

Constants are named in ALL_CAPS, using upper case letters and underscores in their names.

Constants are named in ALL_CAPS, using upper case letters and underscores in their names. Naming conventions in Java The method signature Invoking methods All class names are capitalized Variable names and method names start with a lower case letter, but every word in the name after the first

More information

BLM2031 Structured Programming. Zeyneb KURT

BLM2031 Structured Programming. Zeyneb KURT BLM2031 Structured Programming Zeyneb KURT 1 Contact Contact info office : D-219 e-mail zeynebkurt@gmail.com, zeyneb@ce.yildiz.edu.tr When to contact e-mail first, take an appointment What to expect help

More information

Q1 Q2 Q3 Q4 Q5 Q6 Total

Q1 Q2 Q3 Q4 Q5 Q6 Total Name: SSN: Computer Science Foundation Exam May 5, 006 Computer Science Section 1A Q1 Q Q3 Q4 Q5 Q6 Total KNW KNW KNW ANL,DSN KNW DSN You have to do all the 6 problems in this section of the exam. Partial

More information

CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators)

CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators) Name: Email address: Quiz Section: CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators) Instructions: Read the directions for each question carefully before answering. We will

More information

CSC 160 LAB 8-1 DIGITAL PICTURE FRAME. 1. Introduction

CSC 160 LAB 8-1 DIGITAL PICTURE FRAME. 1. Introduction CSC 160 LAB 8-1 DIGITAL PICTURE FRAME PROFESSOR GODFREY MUGANDA DEPARTMENT OF COMPUTER SCIENCE 1. Introduction Download and unzip the images folder from the course website. The folder contains 28 images

More information

CSE 332 Winter 2015: Midterm Exam (closed book, closed notes, no calculators)

CSE 332 Winter 2015: Midterm Exam (closed book, closed notes, no calculators) _ UWNetID: Lecture Section: A CSE 332 Winter 2015: Midterm Exam (closed book, closed notes, no calculators) Instructions: Read the directions for each question carefully before answering. We will give

More information

Cpt S 122 Data Structures. Course Review Midterm Exam # 2

Cpt S 122 Data Structures. Course Review Midterm Exam # 2 Cpt S 122 Data Structures Course Review Midterm Exam # 2 Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Midterm Exam 2 When: Monday (11/05) 12:10 pm -1pm

More information

Drawing Geometrical Objects. Graphic courtesy of Eric Roberts

Drawing Geometrical Objects. Graphic courtesy of Eric Roberts Methods Drawing Geometrical Objects Graphic courtesy of Eric Roberts Drawing Geometrical Objects Constructors new GRect( x, y, width, height) Creates a rectangle whose upper left corner is at (x, y) of

More information

Closed Computer and Book 1 Double-sided sheet of notes allowed staple to your test when done

Closed Computer and Book 1 Double-sided sheet of notes allowed staple to your test when done CSIS-10B FINAL REVIEW Closed Computer and Book 1 Double-sided sheet of notes allowed staple to your test when done The test may cover any of these topics-- Topics covered since Test 2: Iterators Dictionaries

More information

CS201 Some Important Definitions

CS201 Some Important Definitions CS201 Some Important Definitions For Viva Preparation 1. What is a program? A program is a precise sequence of steps to solve a particular problem. 2. What is a class? We write a C++ program using data

More information

CS 112 Final May 8, 2008 (Lightly edited for 2011 Practice) Name: BU ID: Instructions GOOD LUCK!

CS 112 Final May 8, 2008 (Lightly edited for 2011 Practice) Name: BU ID: Instructions GOOD LUCK! CS 112 Final May 8, 2008 (Lightly edited for 2011 Practice) Name: BU ID: This exam is CLOSED book and notes. Instructions The exam consists of six questions on 11 pages. Please answer all questions on

More information

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9

Aryan College. Fundamental of C Programming. Unit I: Q1. What will be the value of the following expression? (2017) A + 9 Fundamental of C Programming Unit I: Q1. What will be the value of the following expression? (2017) A + 9 Q2. Write down the C statement to calculate percentage where three subjects English, hindi, maths

More information

CS171 Final Practice Exam

CS171 Final Practice Exam CS171 Final Practice Exam Name: You are to honor the Emory Honor Code. This is a closed-book and closed-notes exam. You have 150 minutes to complete this exam. Read each problem carefully, and review your

More information

Points off Total off Net Score. CS 314 Final Exam Spring 2016

Points off Total off Net Score. CS 314 Final Exam Spring 2016 Points off 1 2 3 4 5 6 Total off Net Score CS 314 Final Exam Spring 2016 Your Name Your UTEID Instructions: 1. There are 6 questions on this test. 100 points available. Scores will be scaled to 300 points.

More information

CS171 Final Practice Exam

CS171 Final Practice Exam CS171 Final Practice Exam Name: You are to honor the Emory Honor Code. This is a closed-book and closed-notes exam. You have 150 minutes to complete this exam. Read each problem carefully, and review your

More information

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid CSCE 20/220 Data Structures and Algorithms Prof. Amr Goneid Fall 208 / Spring 209 CSCE 20/220 DATA STRUCTURES AND ALGORITHMS Prof. Amr Goneid Instructor: Prof. Amr Goneid E-mail: goneid@aucegypt.edu Office:

More information

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java CS121/IS223 Object Reference Variables Dr Olly Gotel ogotel@pace.edu http://csis.pace.edu/~ogotel Having problems? -- Come see me or call me in my office hours -- Use the CSIS programming tutors Agenda

More information

CS103L PA4. March 25, 2018

CS103L PA4. March 25, 2018 CS103L PA4 March 25, 2018 1 Introduction In this assignment you will implement a program to read an image and identify different objects in the image and label them using a method called Connected-component

More information

COMP26120: Linked List in C (2018/19) Lucas Cordeiro

COMP26120: Linked List in C (2018/19) Lucas Cordeiro COMP26120: Linked List in C (2018/19) Lucas Cordeiro lucas.cordeiro@manchester.ac.uk Linked List Lucas Cordeiro (Formal Methods Group) lucas.cordeiro@manchester.ac.uk Office: 2.28 Office hours: 10-11 Tuesday,

More information

CS 1302 Chapter 9 (Review) Object & Classes

CS 1302 Chapter 9 (Review) Object & Classes CS 1302 Chapter 9 (Review) Object & Classes Reference Sections 9.2-9.5, 9.7-9.14 9.2 Defining Classes for Objects 1. A class is a blueprint (or template) for creating objects. A class defines the state

More information