Presentation is loading. Please wait.

Presentation is loading. Please wait.

National Chiao Tung University

Similar presentations


Presentation on theme: "National Chiao Tung University"— Presentation transcript:

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

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

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

4 Useful Tools Website: C++ Library Reference
google Debug step by step in Dev-C++. cout

5 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.

6 Examples

7 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:

8 Exercise 2 Advanced: Input: Output: 3

9 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:

10 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 ...

11 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

12 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: 吳昭瑩


Download ppt "National Chiao Tung University"

Similar presentations


Ads by Google