Midterm Exam #2 Review. CS 2308 :: Spring 2016 Molly O'Neil

Similar documents
! Mon, May 5, 2:00PM to 4:30PM. ! Closed book, closed notes, clean desk. ! Comprehensive (covers entire course) ! 30% of your final grade

Midterm Exam Review. CS 2420 :: Fall 2016 Molly O'Neil

Lecture 18 Tao Wang 1

Chapter 17: Linked Lists

9/19/2018 Programming Data Structures. Polymorphism And Abstract

CMPT 117: Tutorial 1. Craig Thompson. 12 January 2009

And Even More and More C++ Fundamentals of Computer Science

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Chapter 10 Introduction to Classes

Chapter 17: Linked Lists

San José State University Department of Computer Science CS-144, Advanced C++ Programming, Section 1, Spring 2018

An Introduction to C++

QUIZ on Ch.5. Why is it sometimes not a good idea to place the private part of the interface in a header file?

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 12: Classes and Data Abstraction

Object Oriented Programming COP3330 / CGS5409

CS24 Week 3 Lecture 1

Beijing Jiaotong University CS-23: C++ Programming Summer, 2019 Course Syllabus

CS 241 Data Organization using C

CSC102 INTRO TO PROGRAMMING WITH PYTHON REVIEW MICHAEL GROSSBERG

OOP- 5 Stacks Individual Assignment 35 Points

Announcements. Lecture 05a Header Classes. Midterm Format. Midterm Questions. More Midterm Stuff 9/19/17. Memory Management Strategy #0 (Review)

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


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)

Purpose of Review. Review some basic C++ Familiarize us with Weiss s style Introduce specific constructs useful for implementing data structures

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

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

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

Programming with Arrays Intro to Pointers CS 16: Solving Problems with Computers I Lecture #11

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University

More C++ : Vectors, Classes, Inheritance, Templates

Ch02. True/False Indicate whether the statement is true or false.

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

Lecture 7. Log into Linux New documents posted to course webpage

! 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)

More C++ : Vectors, Classes, Inheritance, Templates. with content from cplusplus.com, codeguru.com

! 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)

CS 1713 Introduction to Programming II

Linked Lists. Gaddis Ch. 17. CS 2308 :: Spring 2016 Molly O'Neil

Software Design and Analysis for Engineers

CS 132 Exam #1 - Study Suggestions

Special Member Functions

Lecture 13: more class, C++ memory management

EL2310 Scientific Programming

Object Oriented Design

! Data is stored in variables. - Perhaps using arrays and structs. ! Program is a collection of functions that perform

CSE 333 Midterm Exam 7/29/13

Special Member Functions. Compiler-Generated Destructor. Compiler-Generated Default Constructor. Special Member Functions

COMS W3101 Programming Language: C++ (Fall 2016) Ramana Isukapalli

! 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)

More About Classes. Gaddis Ch. 14, CS 2308 :: Fall 2015 Molly O'Neil

CS 241 Data Organization. August 21, 2018

Lecture 14: more class, C++ streams

Assignment 1: grid. Due November 20, 11:59 PM Introduction

CSCI 102L - Data Structures Midterm Exam #2 Spring 2011

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

Lecture 7: Classes and Objects CS2301

EL2310 Scientific Programming

! Data is stored in variables. - Perhaps using arrays and structs. ! Program is a collection of functions that perform

Spring 2003 Instructor: Dr. Shahadat Hossain. Administrative Matters Course Information Introduction to Programming Techniques

Lecture 15: Even more pointer stuff Virtual function table

Programming in C ++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

CISC 3130 Data Structures Spring 2018

Study Guide to Exam 2

CSE 8B Intro to CS: Java

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012

CS270 Computer Organization Fall 2017

Introduction to Classes

CSE 143. Linked Lists. Linked Lists. Manipulating Nodes (1) Creating Nodes. Manipulating Nodes (3) Manipulating Nodes (2) CSE 143 1

CS Final Exam Review Suggestions - Spring 2014

Today s lecture. CS 314 fall 01 C++ 1, page 1

LECTURE 03 LINKED LIST

CS 351: Design of Large Programs.

Abstraction in Software Development

CS183 Software Design. Textbooks. Grading Criteria. CS183-Su02-Lecture 1 20 May by Eric A. Durant, Ph.D. 1

CS3: Introduction to Symbolic Programming. Lecture 14: Lists.

l A class in C++ is similar to a structure. - It allows you to define a new (composite) data type. l A class contains the following: - variables AND

CS304 Object Oriented Programming Final Term

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

G52CPP C++ Programming Lecture 7. Dr Jason Atkin

G52CPP C++ Programming Lecture 9

COMS W3101 Programming Language: C++ (Fall 2015) Ramana Isukapalli

EL2310 Scientific Programming

CS11 Introduction to C++ Fall Lecture 1

! Data is stored in variables. - Perhaps using arrays and structs. ! Program is a collection of functions that perform

Midterm Exam (REGULAR SECTION)

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

! Data is stored in variables. - Perhaps using arrays and structs. ! Program is a collection of functions that perform

Exam 3 Chapters 7 & 9

CPSC 427: Object-Oriented Programming

! Data is stored in variables. - Perhaps using arrays and structs. ! Program is a collection of functions that perform

l A class in C++ is similar to a structure. - It allows you to define a new (composite) data type. l A class contains the following: - variables AND

COMS W3101 Programming Language: C++ (Fall 2015) Ramana Isukapalli

CS503 Advanced Programming I CS305 Computer Algorithms I

Welcome Back. CSCI 262 Data Structures. Hello, Let s Review. Hello, Let s Review. How to Review 1/9/ Review. Here s a simple C++ program:

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED.

Classes in C++98 and C++11

CS Exam 1 Review Suggestions - Spring 2017

Administrivia. CMSC433, Fall 2001 Programming Language Technology and Paradigms. Administrivia (cont.) Project 1. Copy constructor.

CSE 333 Midterm Exam Nov. 3, 2017 Sample Solution

Transcription:

Midterm Exam #2 Review CS 2308 :: Spring 2016 Molly O'Neil

Midterm Exam #2 Wednesday, April 13 In class, pencil & paper exam Closed book, closed notes, no cell phones or calculators, clean desk 20% of your final grade 80 minutes to complete the exam Please bring a pencil and eraser! All writing will be done on exam paper that I'll hand out 2

Exam Format 100 points total ~17 problems, ~8 pages Types of questions: ~50% of total points Multiple choice Fill-in-the-blank (concepts & code) True/false Short answer ~50% of total points Writing functions/code (similar to coding assignments) Fill-in-the-blank coding 3

Lecture Content Slides from lecture: Program Design & Testing ADTs Intro to OOP C++ Multi-File Development More About Classes Linked Lists (Anything from CS 1428 is still fair game, of course!) All lecture slides available on the Schedule page of the course website Animated versions are on TRACS under Resources 4

Assignment Content Homeworks Homework #3 Homework #4 Programming Assignments Project 3 - Pointer Practice Dynamic allocation problems only (no pointer tricks, e.g. "don't use square brackets") Project 4 - Password Manager Including the test plan! Project 5 - MP3Player v. 2.0 Use the driver on TRACS to test your submission Quizzes Quizzes 3, 4, and 5 5

In-Class Code Content Knowledge of the in-class code will never be assumed on the exam; however, they cover several class concepts and are worth reviewing Car class Struct/procedural version and what was wrong with it Class version and why it was better Rectangle class We did this one together on the whiteboard I guarantee there will be something like this on the exam! BetterIntArray class Copy constructor Operator overloading Makefiles 6

Textbook Content Use the textbook to help you understand the slides There will be no questions over material or code that is in the book but NOT in the slides! Covered sections: Chapter 11.1-11.10 (ADTs/Structs) Chapter 13 (Intro to Classes) Chapter 14 (More About Classes) Chapter 17 (Linked Lists) Stuff that is ONLY in lecture slides (not in textbook): Program Design & Testing, C++ Multi-File Development 7

Dynamic Memory / Program Testing Pointers & Dynamic Memory How to dynamically resize an array Program Design & Testing What is software testing? (And what is it not?) Test plan design Write test case to isolate boundary condition 8

ADTs Abstract data types What are they? Compare to a data structure Structs Arrays of structs Pointers to structs Structure pointer operator (->) Equivalent to (*ptr).field (caution: parentheses required!!) Dynamic allocation of structs 9

Intro to OOP/Classes Procedural programming What is it, what's the main problem with it Object-oriented programming What is it, how it addresses issues with procedural prog. Encapsulation, data hiding, and public interfaces Attributes & Actions Class vs. object/instance Declaring a class (e.g., the Rectangle class from HW/class) Members (variables and functions) Private vs. public, access rules Syntax for class declaration Getters and setters, const functions How to define instances/objects of a class How to access class members (dot operator) 10

Intro to Classes (cont.) Inline member function definitions Constructors How to name, return type When are they called? What do they do? Default constructor Constructors with arguments Destructors What are they, how to name them, when are they called? Arrays of objects Declare, initialize, and access Know how to write functions to process arrays of objects 11

C++ Multi-File Development Separating specifications from implementation What goes in which file What needs to include what, and how How to compile Compiling multiple object files + linking executable Makefiles Dependencies Compiling to intermediate object files Be able to write a Makefile rule 12

More About Classes Instance vs. static variables Dynamic allocation of objects Pointers to objects (and -> operator to access members) The "this" pointer And how to use it to resolve name overlap of local vs. member vars Default assignment operator behavior for objects Copy constructors Default shallow copy behavior When shallow copy is a problem How to define your own (i.e., deep copy constructor) When is the copy constructor called Operator overloading Syntax of function definition for ==, <, and > Syntax of use 13

Linked Lists What is a list ADT, what is a linked list Benefits of linked lists over arrays (and vice-versa) Organization Nodes (not in consecutive memory locations!, order defined only by traversal) Head pointer What does an empty list look like? Declaring a linked list class (node structure, head pointer) Creating an empty list (constructor) append() function (find last node, add new node) Traversing a linked list (e.g., display()) Deleting a linked list (deconstructor) 14

Linked Lists (cont.) remove() and insert(): expected to know basic algorithm, but I won't ask you to code these (b/c Project 6 not due yet) Other functions that are fair game (last slide of LL lecture): count(), findmax/min(), prepend(), popfront() [The others (findnumatindex, reverse, remove, insert, insertat, popback, removedups, merge) will be fair game for the final exam, but will not appear on this midterm] 15

How to Prepare Review the slides Understand all the concepts Quiz yourself Review the coding assignments Fix your code if you never got it working! Re-do the written homework problems (without consulting your notes!); check your work against solutions on TRACS Review the quizzes (come to office hours if you want a quiz back) [Quizzes 3, 4, 5] Read the textbook only to increase understanding of slides Textbook has exercises/problems to solve as well Sleep! Eat breakfast! 16