Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2012 Pearson Education, Inc. 9/4/1435 h Sunday Lecture 1 Array’s Terminologies.

Similar presentations


Presentation on theme: "Copyright © 2012 Pearson Education, Inc. 9/4/1435 h Sunday Lecture 1 Array’s Terminologies."— Presentation transcript:

1 Copyright © 2012 Pearson Education, Inc. 9/4/1435 h Sunday Lecture 1 Array’s Terminologies

2 Copyright © 2012 Pearson Education, Inc. Computer Programming (2) Code & No.: CS 104 CREDIT HOURS: 5 UNIT Lecture 3.0 hours/week Lab: 2.0 hour/on every week a.This course introduces the students to the concept of object oriented programming language b.Also deals with instructors, destructors and, functions & operators overloading c.The course also looks into Arrays in details as one of the applications..

3 Copyright © 2012 Pearson Education, Inc. Learning Objectives: Identify the role of programming in our life by learning the principals and Concepts of OOP, Demonstrate understanding of objects, classes Learning the benefits of some special functions like constructors & destructors References: Starting Out with C++ TONNY GADDIS Seventh Edition 3

4 Copyright © 2012 Pearson Education, Inc. Computer Programming (2) Code & No.: CS 104 Pre-requisite: CS 102 Level: 3 rd Course Contents 1. Arrays 2.Introduction to object oriented programming language. 3.several C++ enhancements to C. 4. what classes, objects, member functions and data members are. 5.how destructors are used to perform termination.

5 Copyright © 2012 Pearson Education, Inc.. 5.housekeeping on an object before it is destroyed. 6.what operator overloading is and how it makes programs more readable and programming more convenient. 7.To create classes by inheriting from existing classes and how inheritance promotes software reuse, the use of inheritance to customize existing software.

6 Copyright © 2012 Pearson Education, Inc.. 8.what polymorphism, how it makes programming more convenient and how it makes systems more extensible and maintainable. 9.The formatted input/output and file processing 10. Some applications (Arrays, Queues, Linked Lists, and sorting algorithms. Text books: C ++ How to progrm H. M. Deitel, P. J. Deitel, 1998: Prentice Hal l.

7 Copyright © 2012 Pearson Education, Inc. Arrays

8 Copyright © 2012 Pearson Education, Inc. Q: Define an array? An array is a variable that can store multiple values of the same type Q: Write a format for declaring a one dimensional array? EX: int tests[5]; [ Array Size declarator] ;

9 Copyright © 2012 Pearson Education, Inc. Q: Design an array - Memory Layout for the following array int tests[5]; allocates the following memory: Subscripts 0 1 2 3 4 first element second element third element fourth element fifth element

10 Copyright © 2012 Pearson Education, Inc. Array Terminologies Q: What is the difference between the array size declarator and the array size ? The array size declarator shows the number of elements in the array. The size of an array is the total number of bytes allocated for it. It is = (number of elements) * (number of bytes for each element)

11 Copyright © 2012 Pearson Education, Inc.. Q: Calculate the size of these arrays? 1. int tests[5] is an array of 20 bytes, assuming 4 bytes for an int 2.long double measures[10] is an array of 80 bytes, assuming 8 bytes for a long double


Download ppt "Copyright © 2012 Pearson Education, Inc. 9/4/1435 h Sunday Lecture 1 Array’s Terminologies."

Similar presentations


Ads by Google