CS Final Exam Review Suggestions - Spring 2014

Similar documents
CS Final Exam Review Suggestions - Fall 2017

CS Exam 2 Study Suggestions

CIS 130 Exam #2 Review Suggestions

CS Exam 1 Review Suggestions - Spring 2017

CS Exam 1 Review Suggestions

CS 132 Exam #1 - Study Suggestions

CS Final Exam Review Suggestions

CS Final Exam Review Suggestions - Spring 2018

Spring CS Homework 12 p. 1. CS Homework 12

CS Homework 10 p. 1. CS Homework 10

CS Homework 11 p. 1. CS Homework 11

Objectives. In this chapter, you will:

Chapter 2 Basic Elements of C++

CS Homework 11 p. 1. CS Homework 11

CS1004: Intro to CS in Java, Spring 2005

Full file at

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

C++ for Python Programmers

C++ Basic Elements of COMPUTER PROGRAMMING. Special symbols include: Word symbols. Objectives. Programming. Symbols. Symbols.

Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible)

CS Homework 10 p. 1. CS Homework 10

UNIT- 3 Introduction to C++

Chapter 3. More Flow of Control. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Multiple Choice (Questions 1 14) 28 Points Select all correct answers (multiple correct answers are possible)

Lexical Considerations

QUIZ: What value is stored in a after this

CSCI-1200 Data Structures Spring 2014 Lecture 5 Pointers, Arrays, Pointer Arithmetic

1 Lexical Considerations

Introduction to C Programming

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

CS1622. Semantic Analysis. The Compiler So Far. Lecture 15 Semantic Analysis. How to build symbol tables How to use them to find

Absolute C++ Walter Savitch

Multiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible)

Spring CS Homework 7 p. 1. CS Homework 7

CSCI-1200 Data Structures Fall 2012 Lecture 5 Pointers, Arrays, Pointer Arithmetic

CSE143 Exam with answers MIDTERM #1, 1/26/2001 Problem numbering may differ from the test as given.

static CS106L Spring 2009 Handout #21 May 12, 2009 Introduction

C++ Basics. Data Processing Course, I. Hrivnacova, IPN Orsay

Programming - 1. Computer Science Department 011COMP-3 لغة البرمجة 1 لطالب كلية الحاسب اآللي ونظم المعلومات 011 عال- 3

Deadline. Purpose. How to submit. Important notes. CS Homework 9. CS Homework 9 p :59 pm on Friday, April 7, 2017

COP 2000 Introduction to Computer Programming Mid-Term Exam Review

CS106X Handout 03 Autumn 2012 September 24 th, 2012 Getting Started

Pointers in C/C++ 1 Memory Addresses 2

Topics. bool and string types input/output library functions comments memory allocation templates classes

Chapter 5: Loops and Files

Problem Solving with C++

Python review. 1 Python basics. References. CS 234 Naomi Nishimura

Chapter 5: Prefix vs. Postfix 8/19/2018. The Increment and Decrement Operators. Increment and Decrement Operators in Program 5-1

c++ keywords: ( all lowercase ) Note: cin and cout are NOT keywords.

C++ Programming: From Problem Analysis to Program Design, Third Edition

Programming. C++ Basics

Lexical Considerations

6.001 Notes: Section 15.1

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.

CS Week 14 Lab Exercise

COP 3014: Fall Final Study Guide. December 5, You will have an opportunity to earn 15 extra credit points.

CS107 Handout 08 Spring 2007 April 9, 2007 The Ins and Outs of C Arrays

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

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

C++ Final Exam 2017/2018

Chapter 3. More Flow of Control. Copyright 2008 Pearson Addison-Wesley. All rights reserved.

Operator Overloading and Templates. Linear Search. Linear Search in C++ second attempt. Linear Search in C++ first attempt

CS125 : Introduction to Computer Science. Lecture Notes #4 Type Checking, Input/Output, and Programming Style

Multiple Choice (Questions 1 14) 28 Points Select all correct answers (multiple correct answers are possible)

My First iphone App. 1. Tutorial Overview

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

CS Introduction to Programming Midterm Exam #1 - Prof. Reed Spring 03

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

CprE 288 Introduction to Embedded Systems Exam 1 Review. 1

LECTURE 3 C++ Basics Part 2

Sample Final Exam Questions

Variables and Constants

Example. CS 201 Selection Structures (2) and Repetition. Nested if Statements with More Than One Variable

Programming Standards: You must conform to good programming/documentation standards. Some specifics:


5.1. Chapter 5: The Increment and Decrement Operators. The Increment and Decrement Operators. Looping. ++ is the increment operator.

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program?


CS 142 Style Guide Grading and Details

COMP 202 Java in one week

Introduction to Java Chapters 1 and 2 The Java Language Section 1.1 Data & Expressions Sections

CSc Introduction to Computing

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010

LAB 5, THE HIDDEN DELIGHTS OF LINKED LISTS

sftp - secure file transfer program - how to transfer files to and from nrs-labs

Expressions. Arithmetic expressions. Logical expressions. Assignment expression. n Variables and constants linked with operators

QUIZ. What is wrong with this code that uses default arguments?

Chapter 4 Homework Individual/Team (1-2 Persons) Assignment 15 Points

Curriculum Map Grade(s): Subject: AP Computer Science

Information Science 1

The Design Recipe Fall 2017

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)

COSC 2P95 Lab 5 Object Orientation

Homework 8: Matrices Due: 11:59 PM, Oct 30, 2018

Week 8: Operator overloading

The Design Recipe Fall 2018

Transcription:

CS 111 - Final Exam Review Suggestions p. 1 CS 111 - Final Exam Review Suggestions - Spring 2014 last modified: 2014-05-09 before lab You are responsible for material covered in class sessions, lab exercises, and homeworks; but, here's a quick overview of especially important material. You are permitted to bring into the exam a single piece of paper (8.5" by 11") on which you have handwritten whatever you wish on one or both sides. This paper must include your name, it must be handwritten by you, and it will not be returned. Other than this piece of paper, the exam is closed-note, closed-book, and closed-computer, and you are expected to work individually. (Studying beforehand in groups is an excellent idea, however!) Note that final exams are not returned. I will retain them for at least 2 years, and you may come by my office to see them if you wish after grades are posted into Moodle. The final exam is cumulative in CONCEPTS, but the LANGUAGE of the exam will be C++, to reduce cross-syntax confusion. You will not be writing any Racket for the final. So, you should still use the review suggestions for Exam 1 and Exam 2 for studying for the final exam, but substitute C++ for Racket in the Exam 1-related material. (Note that these review suggestions are still available from the public course web page, under "Homeworks and Handouts".) And, you should still use your Exam 1 and Exam 2 for studying for the final exam, but imagine how those Exam 1 answers would look written in C++. Some questions may be similar in style to those asked on the first two exams, except you would answer them using C++. You are expected to follow course style standards in your exam answers, and there may be exam questions about course style standards as well. You should still be comfortable with the design recipe for functions, and should be able to appropriately fill in the opening comment block "templates" we've been using (and the main and.h file templates as well). Note that the Final Exam will include a References handout that includes both the posted main function template as well as the.h file template and non-main function template. Note that answers may lose points if they show a lack of precision in terminology or syntax. For example, if I ask for a literal or an expression and you give an entire statement, instead; or, if a statement is requested that requires a semicolon, and it is not ended with one; or, if you are asked for a specific code fragment, and you give an entire function. This will be a pencil-and-paper exam, but you will be writing and reading C++ expressions and functions in this format. You will be answering questions about concepts, expressions, and functions as well. Your studying should include careful study of posted examples and notes as well as the homeworks (and posted example solutions) thus far.

CS 111 - Final Exam Review Suggestions p. 2 +=, ++, and more +=, -=, *=, /= What do +=, -=, *=, /= mean? How are they used? What are their effects and semantics? Be able to accurately read, write code fragments containing these operators. ++ and -- What are the prefix and postfix increment operators (++) and the prefix and postfix decrement operators (--)? How are they written? Where are they written? What are their effects and their semantics? If you have int i; and i has been set to some value, what is the difference between ++i and i++ (or between --i and i--)? Be able to accurately read, write code fragments containing these. for statement/for loop, and while loop, continued need to be comfortable with the basics of the C++ for loop statement; need to be comfortable with its syntax and semantics, need to understand how its uses mutation of a local variable to implement repetition when is a for loop appropriate? when is a while loop more appropriate? should be able to read, write a count-controlled loop, a loop that does something a certain number of times. Now that you know about the for-loop, that is the loop of choice for a basic count-controlled loop (One might certainly quite reasonably use a while-loop in some slight variations of count-controlled loops, however! So being familiar with how to use a while-loop in a count-controlled situation can still be useful.) you know that while loops are better for sentinel-controlled loops, and for "other" kinds of loops; you are expected to know, and use, the "classic" structure for a sentinel-controlled loop style, when that logic is what is desired; you are also expected to know, and use, the "question"-controlled loop style, when that logic is what is desired; should be very comfortable with the course-expected indentation for while loops and for loops; you should be able to design, read, and write while loops and for loops; you should be able to read a while loop or a for loop, and tell what it is doing; you should be able to answer questions about what a while loop or for loop does when it executes more on C++ arrays Expect to have to read, write, and use arrays; you should be comfortable with array-related syntax and semantics, and with common "patterns" for using arrays. How do you pass an array as an argument? How do you declare an array as a parameter? In C++, when an array is a parameter for a function, what should also be a parameter of that function?

CS 111 - Final Exam Review Suggestions p. 3 How can you do something to every element within an array? How can you use every element within an array? What particular statements are especially useful in doing such actions? <-- be able to use for loops as well as while loops for this EXPECT IT: you will have to write at least one loop that does something involving every element in an array! how can you declare a dynamically-allocated array? How do you then dynamically allocate such an array? How do you free the allocated memory when you are done with that array? What should the variable involved be set to after this deallocation? different kinds of C++ functions (now including void functions, and functions with no parameters) at this point, you have written "pure" functions that expect parameters and return a result; you have also seen C++ main functions, as well as auxiliary functions that are not so "pure" (they may have side-effects, they may not return anything, they may require no parameters, etc.!) Given a function header, you should know how to then write a "legal" call to that function; How is a void function called? How is a function expects no parameters called? When a function returns a value, how is it (typically) called? How can it also be called if you just care about its side-effects, and not about what it happens to return? When a function expects one or more parameters, how is it called? EXPECT IT: you WILL be given a function header, and be asked to write a "legal" call to that function. file input/output why might you want a program to be able to read from a file? why might you want a program to write to a file? what C++ standard library is used for the file input/output that we used? how do you set up and open a file for reading? how do you set up and open a file for writing?...and how do you close such a file stream when you are done? because the open method requires a char* argument, you should know that the string class's c_str method expects no arguments and returns a char* version of the calling string. once you have opened an input file stream, how can you read something from it? How can you read each line from a file (until the end of file)? once you have opened an output file stream, how can you write something to it? know that opening an output file stream for a given name creates a new file with that name if such a file does not currently exist, and deletes its current contents if it does currently exist. (you are not responsible on the Final Exam for knowing how to open a file for appending to its end, but

CS 111 - Final Exam Review Suggestions p. 4 I hope to post an example of that to the public course web page for your future reference) be comfortable with the getline function for reading in a line at a time from a given input stream (and be aware that, if mixing reads using getline with reads using the >> operator, you MAY need to use an extra getline call to "finish" the preceding line before going on) know that the get method (of an input file stream) can be used for reading in a character at a time (even a blank or tab or other white space) from a calling input stream, and that the eof method (of an input file stream) can be used for reading from a file whose length is not known in advance, and that the fail method (of either an input file stream or an output file stream) can be used to tell if an open of a stream failed, so that your program can react more gracefully in that situation. Formatting output how can you indicate that bool values should be output as true and false? (you are not responsible for how to format numeric output to a specified precision, or how to output in a field of a specified minimum size, but I do hope to post an example of these to the public course web page for your future reference) Putting all of the source code for a C++ program's functions in ONE.cpp file...if you do this, what must you do to include main function's implementation first? (What has to come before the main function's implementation?)...and if you don't do the above, and have the main implementation at the end, in what order must the other implementations of the other functions be put? (Remember: a C++ program consists of one or more functions, one of which is the special function main, where execution starts when the program is run.) intro to pointers what is a pointer? what does it contain? How do you declare a pointer in C++? How do you set it/initialize it? According to class style standards, if a pointer is currently not "pointing" anywhere, then what special value should it be set to? What can you #include in order to get the special value? how can you make a pointer point to something? how can you affect or use what a pointer points to? dynamic memory allocation how can you dynamically allocate memory from the heap/freestore and have a pointer point to that memory? you should be able to do this for arrays as well as scalar (single) variables

CS 111 - Final Exam Review Suggestions p. 5 how can you then free or deallocate this memory when you want the pointer to point somewhere else or when you are simply done with it? what is the special syntax needed if you are doing this for a dynamically-allocated array? what might happen if you do not do this? pass-by-value what is a pass-by-value parameter? how is the argument's value passed to the parameter in this case? for a (non-array) pass-by-value parameter, is the argument changed when the corresponding parameter is changed? Why not? What is the course style standard with regard to changing (non-array) pass-by-value parameters? pass-by-value and pass-by-reference What is a pass-by-reference parameter? How can you tell a pass-by-reference parameter from a pass-byvalue parameter? What is the difference between them? What is the difference in the possible *arguments* between pass-by-value and pass-by-reference parameters? if you change a pass-by-value scalar (single-value) parameter, is the corresponding argument changed? why or why not? if you change a pass-by-reference scalar (single-value) parameter, is the corresponding argument changed? why or why not? arrays are passed by value -- yet if you change the contents of a parameter array, the argument array is changed. Why? input parameters, output parameters, input/output parameters --- what are they? for each, what, in general, type of parameter passing is most appropriate? also note... EXPECT at least one question in which you are given function headers and asked to write appropriate calls of those functions; EXPECT at least one question in which you are asked to write a count-controlled loop to do something a set number of times;