COMP-202: Foundations of Programming. Lecture 26: Review; Wrap-Up Jackie Cheung, Winter 2016

Similar documents
COMP-202: Foundations of Programming. Lecture 26: Image Manipulation; Wrap-Up Jackie Cheung, Winter 2015

COMP-202: Foundations of Programming. Lecture 13: Recursion Sandeep Manjanna, Summer 2015

COMP-202: Foundations of Programming. Lecture 4: Methods Jackie Cheung, Winter 2016

Midterm Exam 2 CS 455, Spring 2015

COMP-202: Foundations of Programming

CS 455 Midterm Exam 2 Fall 2016 [Bono] November 8, 2016

COMP-202: Foundations of Programming. Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2015

CS61BL. Lecture 1: Welcome to CS61BL! Intro to Java and OOP Testing Error-handling

Prelim 1. CS 2110, October 1, 2015, 5:30 PM Total Question Name True Short Testing Strings Recursion

APCS Semester #1 Final Exam Practice Problems

Prelim 2. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer

COMP-202: Foundations of Programming. Lecture 9: Arrays and Practice Jackie Cheung, Winter 2016

CSCI 136: Fundamentals of Computer Science II. Keith Vertanen Museum

COMP-202: Foundations of Programming. Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2016

About this exam review

Algorithms and Programming I. Lecture#12 Spring 2015

COMP-202: Foundations of Programming. Lecture 11: ArrayList, and Linked List Sandeep Manjanna, Summer 2015

COMP 250 Winter 2011 Reading: Java background January 5, 2011

CS 163 Practice Final Exam Winter 2012

Inf1-OP. Inf1-OP Exam Review. Timothy Hospedales, adapting earlier version by Perdita Stevens and Ewan Klein. March 20, School of Informatics

COMP-202: Foundations of Programming. Lecture 8: for Loops, Nested Loops and Arrays Jackie Cheung, Winter 2016

CS 110 Practice Final Exam originally from Winter, Instructions: closed books, closed notes, open minds, 3 hour time limit.

Lecture 1. Course Overview, Python Basics

Announcements. Java Review. More Announcements. Today. Assembly Language. Machine Language

CompSci 125 Lecture 02

McGill University School of Computer Science COMP-202A Introduction to Computing 1

TA office hours are over after this week, but Dan and Maja will still be around for the next month

Practice exam for CMSC131-04, Fall 2017

Chapter 6 Classes and Objects

Course materials Reges, Stuart, and Stepp, Martin. Building Java Programs: A Back to Basics Approach. 2d ed. (Boston: Addison-Wesley, 2011).

CMPT 115. C tutorial for students who took 111 in Java. University of Saskatchewan. Mark G. Eramian, Ian McQuillan CMPT 115 1/32

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

COSC 243. Data Representation 3. Lecture 3 - Data Representation 3 1. COSC 243 (Computer Architecture)

Prelim 2 Solutions. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer

COMP-202: Foundations of Programming. Lecture 5: Arrays, Reference Type, and Methods Sandeep Manjanna, Summer 2015

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

COMP-202: Foundations of Programming. Lecture 7: Strings and Methods Jackie Cheung, Winter 2015

COMP-202: Foundations of Programming. Lecture 14: static, private, public Jackie Cheung, Winter 2015

Topic 10: The Java Collections Framework (and Iterators)

Lecture 1. Course Overview, Python Basics

Object Oriented Programming. Week 1 Part 1 An introduction to Java, Objects and JUnit

TREES Lecture 12 CS2110 Spring 2018

CMPSCI 250: Introduction to Computation. Lecture #1: Things, Sets and Strings David Mix Barrington 22 January 2014

AP Computer Science in Java Course Syllabus

COMP-202: Foundations of Programming. Lecture 4: Flow Control Loops Sandeep Manjanna, Summer 2015

TREES Lecture 12 CS2110 Fall 2016

Prelim 1 Solutions. CS 2110, March 10, 2015, 5:30 PM Total Question True False. Loop Invariants Max Score Grader

CSE115 Introduction to Computer Science I Coding Exercise #7 Retrospective Fall 2017

Course Wrap-up. CSC207 Fall 2015

Administration. Exceptions. Leftovers. Agenda. When Things Go Wrong. Handling Errors. CS 99 Summer 2000 Michael Clarkson Lecture 11

Creating objects TOPIC 3 INTRODUCTION TO PROGRAMMING. Making things to program with.

COMP-202: Foundations of Programming. Lecture 12: Linked List, and File I/O Sandeep Manjanna, Summer 2015

Midterms Save the Dates!

Java Foundations. 7-2 Instantiating Objects. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

(a) Write the signature (visibility, name, parameters, types) of the method(s) required

Programming Languages and Techniques (CIS120)

Public-Service Announcements

CS 113 PRACTICE FINAL

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Java 2. Course Outcome Summary. Western Technical College. Course Information. Course History. Course Competencies

CS 177 Week 15 Recitation Slides. Review

Total Score /1 /20 /41 /15 /23 Grader

ASSIGNMENT 5 Objects, Files, and More Garage Management

Java Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar

Name Section Number. CS210 Exam #3 *** PLEASE TURN OFF ALL CELL PHONES*** Practice

Faculty of Science FINAL EXAMINATION

You have three hours to complete this exam. There are 50 total points.

Last Time. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings

You must bring your ID to the exam.

You will not be tested on JUnit or the Eclipse debugger. The exam does not cover interfaces.

CS 106A, Lecture 27 Final Exam Review 1

IMACS: AP Computer Science A

Compulsory course in Computer Science

Introduction to Linked Lists. Introduction to Recursion Search Algorithms CS 311 Data Structures and Algorithms

CS 455 Midterm Exam 2 Fall 2015 [Bono] Nov. 10, 2015

Question 0. (1 point) Write the correct ID of the section you normally attend on the cover page of this exam if you have not already done so.

CSE 143: Computer Programming II Winter 2019 HW6: AnagramSolver (due Thursday, Feb 28, :30pm)

Introduction to Data Structures

COMP-202 More Complex OOP

Welcome to Python! Ilhoe Jung. Graphics & Media Lab

Ch 7 Designing Java Classes & Class structure

COMP-202: Foundations of Programming. Lecture 22: File I/O Jackie Cheung, Winter 2015

Topic 7: Algebraic Data Types

Outline. Turtles. Creating objects. Turtles. Turtles in Java 1/27/2011 TOPIC 3 INTRODUCTION TO PROGRAMMING. Making things to program with.

CS1004: Intro to CS in Java, Spring 2005

AP Computer Science A (Java) Scope and Sequence

The class Object. Lecture CS1122 Summer 2008

CSCI 102L - Data Structures Midterm Exam #1 Fall 2011

1.00 Introduction to Computers and Engineering Problem Solving. Quiz 1 March 7, 2003

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

JAVA WRAPPER CLASSES

Inheritance and Interfaces

Final Exam Practice. Partial credit will be awarded.

Getting started with Java

Procedural Abstraction

COMP-202: Foundations of Programming. Lecture 5: More About Methods and Data Types Jackie Cheung, Winter 2016

NAME: c. (true or false) The median is always stored at the root of a binary search tree.

Prelim 2 Solution. CS 2110, November 19, 2015, 5:30 PM Total. Sorting Invariants Max Score Grader

CE221 Programming in C++ Part 1 Introduction

Midterm Exam 2 CS 455, Spring 2011

Transcription:

COMP-202: Foundations of Programming Lecture 26: Review; Wrap-Up Jackie Cheung, Winter 2016

Announcements Final is scheduled for Apr 21, 2pm 5pm GYM FIELD HOUSE Rows 1-21 Please submit course evaluations! 2

You can do it! FINAL PREPARATION 3

What's On the Final Everything from assignments Everything from the midterm Control flow (if statements loops, conditions) including the for (type el : container) loop Pass by reference, pass by value Primitive data types (everything before midterm) Binary (converting between bases) Reading from and writing to a file Catching exceptions Recursion Object-oriented programming public vs private constructors (including the default constructor) static, final attributes/properties/fields methods getters and setters overloading methods and constructors defining classes and using objects Data Structures arrays, ArrayLists, HashSets 4

Linked lists HashMap What's Not On the Final Throwing exceptions Other advanced topics (edit distance, distributional semantics, binary search, sorting algorithms, recursive data structures) 5

Format Same as midterm: T/F Multiple choice Multi-select Hand-written coding questions You are allowed: 1 double-sided 8.5"x11" crib sheet, hand-written or typed No electronic devices permitted 6

How To Study 1. Review slides, practice problems 2. Review assignments 3. Create your own crib sheet 4. Ask questions at office hours, tutorials Office hours continue into next week 5. Do past final exam(s) 7

General Suggestions Get good at reading code, tracing its execution, and figuring out what it does! Compared to the midterm, the final will be more about thinking about how some code runs, and less about definitions and the mechanics of Java (though some questions will still be like this). 8

Final exercises PRACTICE QUESTIONS 9

Logic Let a, b, and c be Boolean variables a is true iff it rained yesterday b is true iff it rained two days ago c is true iff it rained three days ago 1. Write a logical expression that is equivalent to it rained on exactly one of the past three days. 2. Now, write a logical expression that is equivalent to it rained on exactly two of the past three days. 10

OfficeChair Write a OfficeChair class with adjustable height: One attribute: height (int) There is a default height in cm (say, 75) There is a getter for the height Chairs have a min and max height for safety: min: 50 max: 100 This is the same for all OfficeChair instances There is a setter for the height, but it cannot set the height to an unsafe value. If you try to, it sets it to the closest safe value. (e.g., if you try to set the height to -20, it will set it to 50 (the min)). 11

HashSet Write a method, sameletters, that takes in two strings and returns whether or not they are composed of the same set of letters, in any order sameletters( hat, that ) -> true sameletters( hat, heat ) -> false sameletters( hat, aaaaaahhhhhttttt ) -> true 12

Recursion Write a method that computes f(x) = x 2 recursively, using only addition and multiplication (no Math library calls, iteration, or multiplying x by itself). Your method should work for all non-negative ints. Hint: write f(x) in terms of f(x 1) 13

What have we done? COURSE SUMMARY 14

Algorithmic Thinking We've learned something very powerful in this class: Solving problems algorithmically Communicating precise instructions to a computer using a programming language 15

Modelling the World We've also started to look at how to model things in the world using constructs in Java: Objects in Java Collections such as ArrayList, HashSet, HashMap Different ways of representing the same data, and the relative advantages and disadvantages of each 16

Powerful Tools! Computers let us process and analyze a lot more data than we could ourselves: Information access: search engines, database queries Analyze genetic, economic, language, statistical, social data Smart and secure storage and transfer of data You now have the basic knowledge to understand how all of these things work! 17

Next Steps If you'd like to take further COMP courses: COMP 250: Introduction to Computer Science COMP 206: Introduction to Software Systems COMP 230: Logic and Computability 18

COMP 250: Intro to CS Most similar to this course, but in more depth and with more theoretical rigour: Java (go through basics quickly) Algorithms design and analysis Data structures Proving that your code is correct 19

COMP 206: Software Systems Learning multiple languages C, Python, Perl Useful tools for working with software in different environments Debuggers Development tools Keeping track of changes in files Interfacing with the OS 20

COMP 230: Logic and Computability Theoretical side of CS: Propositional and predicate logic Proof systems Models of computation What problems can a computer solve or not solve? Solve efficiently or not solve efficiently? 21

No Time for More CS Courses? 22

It's Okay! The best teacher of CS and programming is yourself! Especially since you already know the basic concepts behind all of the popular programming languages! 23

C# using System; class Program { public static void Main(string[] args) { Console.WriteLine("Hello, world!"); } } 24

Python print "Hello, world!" 25

C #include <stdio.h> int main() { printf("hello, world!\n"); } 26

Matlab disp('hello, world!') 27

Good Luck! 28