National Chiao Tung University

Slides:



Advertisements
Similar presentations
Chapter 3 Objects, types, and values Bjarne Stroustrup
Advertisements

Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 4 Modular Programming with Functions.
This Time Whitespace and Input/Output revisited The Programming cycle Boolean Operators The “if” control structure LAB –Write a program that takes an integer.
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
Chapter 3. Expressions and Interactivity CSC125 Introduction to C++
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
COSC 120 Computer Programming
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 11/3/08CS150 Introduction to Computer Science 1 Reading from and Writing to Files Section 3.12 & 13.1 & 13.5.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
CS102--Object Oriented Programming Discussion 1: – Project 4 on Page 328 – The use of arrays Copyright © 2008 Xiaoyan Li.
CMPUT 101 Lab #6 October 29, :00 – 17:00. Array in C/C++ Array is a structure type variable. One dimension of array int: int num[3]; There are.
1 10/9/06CS150 Introduction to Computer Science 1 for Loops.
1 CS150 Introduction to Computer Science 1 Exponents & Output page & Section 3.8.
1 10/25/06CS150 Introduction to Computer Science 1 Reading from and Writing to Files.
1 9/26/07CS150 Introduction to Computer Science 1 Exponents & Output page & Section 3.8.
 2003 Prentice Hall, Inc. All rights reserved. 1 Introduction to C++ Programming Outline Introduction to C++ Programming A Simple Program: Printing a.
Introduction to PASS, and Exercises on Operators and Basic I/O.
1 計算機程式設計 Introduction to Computer Programming Lecture01: Introduction and Hello World 9/10/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction.
Chapter 02 (Part III) Introduction to C++ Programming.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
Saturday, 09 September 2006 ©RSH Number Square and Cube Numbers.
Type Conversions Implicit Conversion Explicit Conversion.
CS Class 08 Today  Exercises  Nested loops  for statement  Built-in functions Announcements  Homework #3, group solution to in-class.
CPS120: Introduction to Computer Science Lecture 15 Arrays.
End of unit assessment Challenge 1 & 2. Course summary So far in this course you have learnt about and used: Syntax Output to screen (PRINT) Variables.
Powers and roots. Square each number a) 7 b) 12 c) 20 d) 9 e) 40 a) 49 b) 144 c) 400 d) 81 e) 1600.
CS Class 03 Topics  Sequence statements Input Output Assignment  Expressions Read pages Read pages 40 – 49 for next time.
Count Controlled Loops (Nested) Ain’t no sunshine when she’s gone …
Agenda  Take up homework  Loops - Continued –For loops Structure / Example involving a for loop  Storing Characters in variables  Introduction to Functions.
Homework 1 (due:April 10th) Deadline : April 10th 11:59pm Where to submit? eClass 과제방 ( How to submit? Create a folder. The name.
1 2/2/05CS250 Introduction to Computer Science II Pointers.
Homework 1 (due:April 8th) Deadline : April 8th 11:59pm Where to submit? eClass “ 과제방 ” ( How to submit? Create a folder. The name.
For loop. Exercise 1 Write a program to have the user input three (3) numbers: (f)rom, (t)o, and (i)ncrement. Count from f to t in increments of i, inclusive.
Homework 2 (due:April 17th) Deadline : April 17th 11:59pm Where to submit? eClass “ 과제방 ” ( How to submit? Create a folder. The.
C++ Programming Lecture 13 Functions – Part V By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Object Oriented Programming (OOP) LAB # 3 TA. Maram & TA. Mubaraka TA. Kholood & TA. Aamal.
Homework 1 (due:April 13th) Deadline : April 13th 11:59pm Where to submit? eClass 과제방 ( How to submit? Create a folder. The name.
Exercise 2 : Using for loop Repetition (loop) (1)control variable initialization (2)Test Conditon (3)Modification of control variable value order : (1)
GNG1106 Lab # 8 C Structures and Files Slides by: Mohamad Eid Contributors: Diana Inkpen, Alan Williams, Daniel Amyot.
Chapter 15 - C++ As A "Better C"
Command Line Arguments
Chapter 3: Expressions and Interactivity.
Object-Orientated Programming
CS149D Elements of Computer Science
Administrative things
Chapter 3 Input output.
CS150 Introduction to Computer Science 1
Arrays.
CS150 Introduction to Computer Science 1
Chapter 6: User-Defined Functions I
From C to C++: Summary of weeks 1 - 4
C++ Pointers and Strings
C ( Programming Language ) PSK Technologies By: Arti Sontakke An ISO 9001:2015 (QMS) Certified IT Company Computer Education | Software Development | Computer.
Summary of what we learned yesterday
COMPUTER 2430 Object Oriented Programming and Data Structures I
Fundamental Programming
C Programming Pointers
Homework 2 (due:May 15th) Deadline : May 15th 11:59pm
Homework 1 (due:April 17th)
Reading from and Writing to Files
Homework 2 (due:May 5th) Deadline : May 5th 11:59pm
Recitation Course 0603 Speaker: Liu Yu-Jiun.
Review Lab assignments Homework #3
Introduction to C Programming
Reading from and Writing to Files Part 2
C++ Pointers and Strings
Homework 2 (due:May 13th) Deadline : May 11th 11:59pm
Reading from and Writing to Files
Presentation transcript:

National Chiao Tung University OOP Recitation Course Liu Yu-Jiun 2009/3/11 National Chiao Tung University

Introduction Recitation Course for Object Oriented Programming (#1538). TA: 劉育君 Email: liuyj.ellen@gmail.com TA time: Tue. 13:30~15:30 8 times: 1 point; all times: 2 points

Outline Useful Tool for C++ The Concept of Pointer Examples Exercises HW1 Announcement

Useful Tools Website: C++ Library Reference http://www.cplusplus.com/reference/ http://www.cppreference.com/wiki/ google Debug step by step in Dev-C++. cout

Pointer A Pointer to int, double, etc. Example: double *p; // p is “point type” variable p may contain a pointer to a variable of type double.

Examples

Exercise 1 Enter two numbers m and n on screen, and create a m*n array. Then set all values in this array be 2, and output them. Input: Output: 3 4 2 2 2 2 2 2 2 2

Exercise 2 Advanced: Input: Output: 3 2 2 2 2 1 2 2 2 3

Exercise 3 2.28 Write a program that inputs a five-digit integer, separates the integer into its individual digits and prints the digits separated from one another by three spaces each. input: 42339 output: 4 2 3 3 9

Exercise 4 2.29 Write a program that calculates the squares and cubes of the integers from 0 to 10 and uses tabs to print the following neatly formatted table of values: output: integer square cube 0 0 0 1 1 1 2 4 8 ... 10 100 1000

HW1 Assignment Input Sample Output Sample 3 1 withdraw 1000 from a0012 deposit 1000 to a0102 transfer 500 from a0102 to a1102 withdraw 300 from a1102 2 deposit 1000 to a0123 transfer 300 from a0123 to a1023 4 1 3 2 1 3 2 5 1 error query! deposit 1000 to a0102 transfer 300 from a0123 to a1023

HW1 Assignment Deadline: 2009/3/24 11:59 p.m. Score: HW1 TA: Passing one test data gets one point, total 10 points. HW1 TA: 吳昭瑩 lachao@gmail.com