Review for Final Exam.

Slides:



Advertisements
Similar presentations
Chapter 7: User-Defined Functions II
Advertisements

Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Chapter 7: User-Defined Functions II Instructor: Mohammad Mojaddam.
Chapter 5 Functions.
Wednesday, 12/11/02, Slide #1 CS 106 Intro to Comp. Sci. 1 Wednesday, 12/11/02  QUESTIONS??  Today: CLOSING CEREMONIES!  HW #5 – Back Monday (12/16)
Wednesday, 10/9/02, Slide #1 CS 106 Intro to CS 1 Wednesday, 10/9/02  QUESTIONS ??  Today:  Discuss HW #02  Discuss test question types  Review 
1 Lecture 20:Arrays and Strings Introduction to Computer Science Spring 2006.
Chapter 9: Arrays and Strings
Chapter 9: Arrays and Strings
Chapter 8 Arrays and Strings
Arrays. Objectives Learn about arrays Explore how to declare and manipulate data into arrays Learn about “array index out of bounds” Become familiar with.
Chapter 2: Basic Elements of Java J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Modular Programming Chapter Value and Reference Parameters computeSumAve (x, y, sum, mean) ACTUALFORMAL xnum1(input) ynum2(input) sumsum(output)
Chapter 8 Arrays and Strings
C++ Programming: From Problem Analysis to Program Design, Fifth Edition, Fifth Edition Chapter 7: User-Defined Functions II.
Project 1 Due Date: September 25 th Quiz 4 is due September 28 th Quiz 5 is due October2th 1.
EGR 2261 Unit 8 One-dimensional Arrays  Read Malik, pages in Chapter 8.  Homework #8 and Lab #8 due next week.  Quiz next week.
EGR 2261 Unit 9 Strings and C-Strings  Read Malik, pages in Chapter 7, and pages in Chapter 8.  Homework #9 and Lab #9 due next week.
C++ Programming: Basic Elements of C++.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Arrays.
CIS-165 C++ Programming I CIS-165 C++ Programming I Bergen Community College Prof. Faisal Aljamal.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
CHAPTER 7 arrays I NTRODUCTION T O C OMPUTER P ROGRAMMING (CSC425)
More Array Access Examples Here is an example showing array access logic: const int MAXSTUDENTS = 100; int Test[MAXSTUDENTS]; int numStudents = 0;... //
Review for Final Exam. Contents 5 questions (20 points each) + 1 bonus question (20 points) – Basic concepts in Chapters 1-4 – Chapters 5-9 – Bonus: Chapter.
Liang, Introduction to C++ Programming, (c) 2007 Pearson Education, Inc. All rights reserved X 1 Chapter Array Basics.
Modular Programming – User Defined Functions. CSCE 1062 Outline  Modular programming – user defined functions  Value returning functions  return statement.
Functions Math library functions Function definition Function invocation Argument passing Scope of an variable Programming 1 DCT 1033.
C++ Programming Lecture 13 Functions – Part V The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
1 For Loops l From Chapter 9 l A shorthand way of coding count loops.
1 Programming in C++ Dale/Weems/Headington Chapter 9 Additional Control Structures (Switch, Do..While, For statements)
Java Programming: From Problem Analysis to Program Design, Second Edition 1 Lecture 1 Objectives  Become familiar with the basic components of a Java.
Arrays Declaring arrays Passing arrays to functions Searching arrays with linear search Sorting arrays with insertion sort Multidimensional arrays Programming.
C++ Programming Lecture 13 Functions – Part V By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
A FIRST BOOK OF C++ CHAPTER 7 ARRAYS. OBJECTIVES In this chapter, you will learn about: One-Dimensional Arrays Array Initialization Arrays as Arguments.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 8: Namespaces, the class string, and User-Defined Simple Data Types.
Functions + Overloading + Scope
Test 2 Review Outline.
UMBC CMSC 104 – Section 01, Fall 2016
Chapter 7 User-Defined Methods.
Exam 2 Review.
Chapter 7: User-Defined Functions II
EGR 2261 Unit 9 One-dimensional Arrays
CS Computer Science IA: Procedural Programming
Computer Programming BCT 1113
Java Programming: From Problem Analysis to Program Design, 4e
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
User Defined Functions
Additional Control Structures
Chapter 2: Basic Elements of Java
Review for Midterm Exam
Chapter 7 Additional Control Structures
Review for Final Exam.
Programming Funamental slides
CSCI 3327 Visual Basic Review: Final Exam
CS 1428 Final Exam Review.
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
Review for Midterm Exam
Review for Midterm Exam
EGR 2261 Unit 12 structs Read Malik, Chapter 9.
CS 1428 Final Exam Review.
Chapter 7: User-Defined Functions II
Review for Midterm Exam
CSCI 3328 Object Oriented Programming in C# Review: Final Exam
Review for Midterm Exam
Fundamental Programming
Standard Version of Starting Out with C++, 4th Edition
Presentation transcript:

Review for Final Exam

Contents 5 questions (20 points each) + 1 bonus question (20 points) Basic concepts in Chapters 1-4 Chapters 5-9 Bonus: Chapter 5 Question types Write down the output of the code Write the code Debug errors in the code Review Lecture slides Exercises (1)~(19) in class (on the course Web page) Review problems for final exam (on the course Web page)

Time & Place & Event Time: 5:45pm - 7:30 pm, May 6 (Tuesday) Place: Math & General Classroom 2.206 Closed-book exam You can take a piece of cheating paper with A4 size Write down whatever that you think is important (on both sides) with any font size

Chapter 2: Basic Elements of C++ Special symbols, keywords, rules of identifiers Basic data types int, float, double, char, string Operators Arithmetic operators and their precedence +, -, *, /, %, +=, -=, *=, /= Increment/decrement operator ++, -- Declaration of variables int first=13, second=10; char ch=' '; Input/Output statement cin and cout

Chapter 3: Input/Output Declaration of input/output stream Usage of cin and cout (as well as other istream/ostream variables)

Chapter 4: Control Structures I (Selection) Relational operators and precedence Comparison operators <, <=, >, >=, ==, != String comparison Logical operators &&, | | Evaluation of logical expression

Chapter 4: Control Structures I (Selection, cont'd) Syntax and usage of the selection structure One-way selection: if () { } Compound statements Two-way selection: if () { } else { }

Chapter 5: Control Structures II (Repetition) Repetition structure Syntax and usage of the "for" loop The nested for loop

Chapters 6 & 7: User-Defined Functions Two types of user-defined functions Value-returning functions and void functions Differences Syntax of function heading Function prototype Function heading without the body of the function

Chapters 6 & 7: User-Defined Functions (cont'd) Function call Use function name together with the actual parameter list Two types of formal parameters Value parameters Reference parameters Differences Scope of an identifier Local identifier Global identifier

Chapters 6 & 7: User-Defined Functions (cont'd) Function overloading several functions with the same name but different parameter lists Default parameters in function prototype Places of default values Default values cannot be assigned to reference parameters See legal and illegal examples in lecture slides

Chapter 8: User-Defined Simple Data Types, Namespaces, and the string Type Syntax of declaring an enumeration data type Syntax of declaring a namespace String data type Syntax of declaring and initializing a string variable string name = "William Jacob"; Syntax of accessing characters in the string using array subscript operator [] name[0]

Chapter 8: User-Defined Simple Data Types, Namespaces, and the string Type (cont'd) Basic operations/methods of string data type str = name + " Day"; name.length()

Chapter 9: Arrays and Strings* Declaration and initialization of arrays Syntax and usage Accessing array components array subscripting operator [ ] How to use for loops to access array elements for (i = 0; i < 100; i++) Initialization: list[i] = 0.0; read data: cin >> list[i]; Print data: cout << list[i]; Search a key item from the array find the sum, average, largest See lecture slides int num[5];

Chapter 9: Arrays and Strings* (cont'd) Array initialization during the declaration double sales[] = {12.25, 32.50, 16.90, 23, 45.68}; int list[10] = {0}; int list[10] = {8, 5, 12}; int list[] = {5, 6, 3}; int list[25]= {4, 7}; See lecture slides Restrictions of array Does not allow aggregate operations Must use for loop to copy from one array to another

Chapter 9: Arrays and Strings* (cont'd) C-String (character array) C-strings are null-terminated ('\0') character arrays Declaration and initialization char name[16] = "John"; char name[] = "John"; Access the character in the C-String name[0] ~ name[3] '\0' is not counted at the length of the C-String Parallel arrays Two (or more) arrays holding related information in the corresponding components 2-dimensional arrays

Good Luck! Q/A