SlideShare a Scribd company logo
1 of 32
Download to read offline
Object-Oriented Programming Using C#
Objectives


               In this session, you will learn to:
                  Describe memory allocation
                  Use structure
                  Use enumerations
                  Implement arrays
                  Use collections




    Ver. 1.0                        Session 7        Slide 1 of 32
Object-Oriented Programming Using C#
Describing Memory Allocation


               The memory allocated to variables is referred to in the
               following ways:
                – Value types: Contains data. Built-in data types, such as int,
                  char, and float are value types.
                – Reference types: Contains address referring to a block of
                  memory. Data types, such as string and class are reference
                  types.


               Let us understand the concept of memory allocation in
               detail.




    Ver. 1.0                        Session 7                             Slide 2 of 32
Object-Oriented Programming Using C#
Describing Memory Allocation (Contd.)


                   Value Type:

               int Num1;     Variable Declaration
               Num1=50;                                                        Num1
                             Initialization
                                                                               50


                                               Both Num1 and Num2 Contain 50

                                                                               Num2

                                                                               50
           int Num2;             Variable Declaration
           Num2=Num1;            Initializing Num2 with Num1




    Ver. 1.0                             Session 7                             Slide 3 of 32
Object-Oriented Programming Using C#
Describing Memory Allocation (Contd.)


                 Value Type (Contd.):


                                                               Num1
               New Value Assigned to Num1          Num1=60;
                                                               60




                The Value of Num2 Remains Unaffected          Num2
                                                              50




    Ver. 1.0                          Session 7                       Slide 4 of 32
Object-Oriented Programming Using C#
Describing Memory Allocation (Contd.)


                 Reference Type:

               Car Suzuki= new Car();           Object of Class Car()
               Suzuki.Model=10;                 Initialization
                                                Member Variable of Class Car()




                      Car Mercedes;                  Object of Class Car()
                      Mercedes=Suzuki;               Initializing Mercedes with Suzuki




    Ver. 1.0                            Session 7                                  Slide 5 of 32
Object-Oriented Programming Using C#
Describing Memory Allocation (Contd.)


                Reference Type (Contd.):
                                                     Suzuki
               Referring to Memory
                                                       ***
               Location Where the Data
               is Stored



                                                                       10




                                                     Mercedes
               Referring to Memory
                                                      ***
               Location Where the Data
               is Stored



    Ver. 1.0                             Session 7              Slide 6 of 32
Object-Oriented Programming Using C#
Using Structure


               • A structure is a value type data type.
               • When you want a single variable to hold related data of
                 various data types, you can create a structure.
               • To create a structure you use the struct keyword.
               • The following code shows the example of a declaring a
                 structure names Bill_Details:
                  struct Bill_Details
                  { public string inv_No;    // Invoice Number
                    string ord_Dt; // Order Date
                    string custName; // Customer name




    Ver. 1.0                         Session 7                        Slide 7 of 32
Object-Oriented Programming Using C#
Using Structure (Contd.)


                   public string product;    // Product Name
                   public double cost; // Cost of the product
                   public double due_Amt; // Total amount due
               }




    Ver. 1.0                    Session 7                  Slide 8 of 32
Object-Oriented Programming Using C#
Using Enumeration


               • Enumeration is a value type data type.
               • Enumeration contains its own values and cannot inherit or
                 pass inheritance.
               • Enumerators allows you to assign symbolic names to
                 integral constants.
               • To enumerate, you can use the enum keyword.




    Ver. 1.0                         Session 7                       Slide 9 of 32
Object-Oriented Programming Using C#
Declaring an Enumeration


               • The following code is an example of declaring an
                 enumeration named Days:
                  enum Days { Sat, Sun, Mon, Tue, Wed, Thu, Fri };




    Ver. 1.0                        Session 7                       Slide 10 of 32
Object-Oriented Programming Using C#
Implementing Enumerations


               After declaring the enumeration type, you can use the
               enumeration type in the same manner as any other data
               type:
               int First_Day = (int)Days.Sat;
               int Last_Day = (int)Days.Fri;




    Ver. 1.0                     Session 7                      Slide 11 of 32
Object-Oriented Programming Using C#
Implementing Arrays


               An array is a collection of values of the same data type.
               The following figure shows the array structure in the
               system’s memory.




                                    Index           Index

                                    Value 0         Value 6




    Ver. 1.0                       Session 7                         Slide 12 of 32
Object-Oriented Programming Using C#
Declaring an Array


               An array needs to be declared before it can be used in a
               program.
               You can declare an array by using the following statement:
                datatype[] Arrayname;


               Let us understand the explanation of the various elements
               of the array declaration through an example.




    Ver. 1.0                      Session 7                        Slide 13 of 32
Object-Oriented Programming Using C#
Declaring an Array (Contd.)


               int[ ] Score;               Datatype
                                           Is used to specify the
                                           data type for the
                                           elements




    Ver. 1.0                   Session 7                    Slide 14 of 32
Object-Oriented Programming Using C#
Declaring an Array (Contd.)


               int[ ] Score;               []
                                           Is used to specify the
                                           rank of the array




    Ver. 1.0                   Session 7                    Slide 15 of 32
Object-Oriented Programming Using C#
Declaring an Array (Contd.)


               int[ ] Score;               Arrayname
                                           Is used to specify the
                                           name of the array using
                                           which the elements of the
                                           array will be initialized and
                                           manipulated




    Ver. 1.0                   Session 7                     Slide 16 of 32
Object-Oriented Programming Using C#
Initializing and Assigning Values to Array


                • In C#, you can initialize the array variable and can assign
                  values to the array elements. In addition, you can copy the
                  array variable to another variable.
                • During initialization, you need to use the new keyword to
                  create an instance of the array. In addition, the size of the
                  array is also specified while it is initialized.
                • The following is an example of array initialization:
                    int[] Score; // Array declaration
                    Score = new int[10]; //Array Instance




     Ver. 1.0                          Session 7                         Slide 17 of 32
Object-Oriented Programming Using C#
Initializing and Assigning Values to Array (Contd.)


                You can assign values to each element of the array by
                using the index number, which is called the array subscript
                of the element.
                The following is an example of assigning values to the
                array:
                 int[] Score = new int[3];
                 Score[0]=10;
                Or
                 int[] Score={5,10,15};
                When you copy the array variable, both the source and
                target variable refer to the same array instance in the
                memory.
                The following is an example of copying the array variables:
                 int[] Source = new int[10] {0, 1, 2, 3, 4};
                 int[] Target= Source;
     Ver. 1.0                      Session 7                         Slide 18 of 32
Object-Oriented Programming Using C#
Manipulating Array Elements


               • When an array is initialized, you can access the element
                 values and manipulate them.
               • The foreach loop is specially used for manipulating arrays.
               • The following is the syntax of the foreach loop:
                  foreach (type identifier in expression)
                  {
                     //statements
                  }




    Ver. 1.0                        Session 7                       Slide 19 of 32
Object-Oriented Programming Using C#
Manipulating Array Elements (Contd.)


               • The following is the example of foreach loop:
                  int[] Numbers = { 4, 3, 2, 1, 0, -1, -2, 9, 5 };
                  Console.WriteLine("The Contents of an Array
                  is:");
                  foreach (int K in Numbers)
                  {
                     Console.WriteLine("{0} t",K);
                  }




    Ver. 1.0                        Session 7                    Slide 20 of 32
Object-Oriented Programming Using C#
Manipulating Array Elements (Contd.)


               • While declaring a method if you are not sure about the
                 number of arguments passed as a parameter, you can use
                 the param array.
               • The following is the example of param array:
                  public int Adding_ArrayElement(params int[]
                  List)
                  {
                     int Total = 0;
                     foreach ( int I in List )
                     {
                           Total += I;
                     }
                     return Total;
                  }

    Ver. 1.0                       Session 7                     Slide 21 of 32
Object-Oriented Programming Using C#
Demo: Matrix Subtraction Using Arrays


               Problem Statement:
                  David, a student of California University, is currently pursuing
                  mathematics. He is working on a project named Matrix
                  Subtraction. He needs to perform the following tasks for his
                  project:
                   • Accept data in two Arrays.
                   • Perform the subtraction operation.
                   • Verify the value of subtraction.
                  Help David to create the C# program using Visual Studio IDE.




    Ver. 1.0                        Session 7                              Slide 22 of 32
Object-Oriented Programming Using C#
Demo: Matrix Subtraction Using Arrays (Contd.)


               Solution:
                  To solve the preceding problem, David needs to perform the
                  following tasks:
                   1. Create a console-based application for Matrix Subtraction.
                   2. Build and execute an application.




    Ver. 1.0                         Session 7                                Slide 23 of 32
Object-Oriented Programming Using C#
Multidimensional Arrays


               The rank value of the array is also known as the dimension
               of the array.
               The array can be single dimensional or multidimensional.
               Single dimensional array stores data in a row.
               Multidimensional array stores data using different
               dimensions.
               The following figure is a graphical representation of values
               stored in a single dimensional array and a multidimensional
               array.
                            int [] Num;                    int[,] Num;

                                                       0

                           0   1   2   3   4           1

                                                            0   1   2    3   4




    Ver. 1.0                               Session 7                             Slide 24 of 32
Object-Oriented Programming Using C#
Multidimensional Arrays (Contd.)


               • The Array class is the base class for all the arrays in C#.
               • The Array class provides properties and methods to work
                 with arrays.
                   – Properties: The following table explains some of the most
                     commonly used properties of the Array class.

                       Properties        Explanation

                       Length            Returns the total number of items in all the dimensions of an
                                         array
                       Rank              Returns the total number of items in all the dimensions of an
                                         array
                       IsFixedSize       Return a value indicating if an array has a fixed size or not

                       IsReadOnly        Returns a value indicating if an array is read-only or not




    Ver. 1.0                           Session 7                                                Slide 25 of 32
Object-Oriented Programming Using C#
Multidimensional Arrays (Contd.)


               – Methods: The following table explains some of the most
                 commonly used methods of the Array class.


                  Properties   Explanation
                  Sort         Performs sort operation on an array passed to it as a parameter
                  Clear        Removes all items of an array and sets a range of items in the
                               array to 0
                  GetLength    Returns the number of items in an Array
                  GetValue     Returns the value of the specified item in an Array
                  IndexOf      Returns the index of the first occurrence of a value in a
                               one-dimensional Array or in a portion of the Array




    Ver. 1.0                             Session 7                                               Slide 26 of 32
Object-Oriented Programming Using C#
Using Collections


               • Arrays are used to collect the elements of same data type.
               • The .NET Framework provides several classes that also
                 collect elements in specialized ways. Theses classes are
                 the Collection classes, and are declared in the
                 System.Collections namespace and sub-namespaces.




    Ver. 1.0                        Session 7                       Slide 27 of 32
Object-Oriented Programming Using C#
Using Collections (Contd.)


               • The collection classes accept, hold, and return their
                 elements as items.
               • The element type of collection class is an object. Object is a
                 reference type.
               • The following figure shows the storage of values in array of
                 type int:
                                   STACK                          HEAP




                                   Array

                                    @                        9       7   3   2


                                    int [] array= {9, 7, 3, 2};




    Ver. 1.0                            Session 7                                Slide 28 of 32
Object-Oriented Programming Using C#
Using Collections (Contd.)


               The action which automatically converts the value type to
               the reference type, is known as boxing.
               The following figure shows the boxing technique.
                         STACK                HEAP




                                                     7             2

                         Array

                         @               @         @           @   @



                                          9                    3


                                 int [] array= {9, 7, 3, 2};




    Ver. 1.0                        Session 7                          Slide 29 of 32
Object-Oriented Programming Using C#
Using Collections (Contd.)


               • When you want to access the elements of an array through
                 its index value location in an array, use an ArrayList
                 class.
               • The following table describes the use of various methods of
                 an ArrayList class.
                  Method       Use
                  Add          Adds an object to the end of the ArrayList
                  Remove       Removes the element at the first occurrence of a specific object from the
                               ArrayList
                  Clear        Removes all the elements from the ArrayList
                  Insert       Inserts an element into the ArrayList at the specified index
                  TrimToSize   Sets the capacity to the actual number of elements in the ArrayList
                  Sort         Sorts the elements in the ArrayList
                  Reverse      Reverses the element in the ArrayList




    Ver. 1.0                                 Session 7                                               Slide 30 of 32
Object-Oriented Programming Using C#
Summary


              In this session, you learned that:
               – Memory allocated to variables are of two types, value type and
                 reference type.
               – Value-types are the simplest types in C#. Variables of value
                 types directly contain their data in the variable.
               – Reference-types variables contain only a reference to data.
                 The data is stored in a separate memory area.
               – A value type variable holds its value in the stack.
               – A reference type variable holds a reference to an object in the
                 heap.
               – To hold related data of various data type in single variable,
                 structures are used.
               – C# provides the features of enum to create user defined data
                 types with numbers as an index value to access them.
               – An array is a collection of values of the same data type.

   Ver. 1.0                        Session 7                            Slide 31 of 32
Object-Oriented Programming Using C#
Summary (Contd.)


               – The foreach statement interprets the common loop process
                 and removes the need for you to check the array size.
               – Param arrays are used in the methods with parameter list
                 when the total number of parameters is not known.
               – The .NET Framework provides several classes that also collect
                 elements together in other specialized ways. These are the
                 Collection classes, and they live in the System
                 namespace.
               – ArrayList is useful when you want to manipulate the values
                 in an array easily.




    Ver. 1.0                      Session 7                           Slide 32 of 32

More Related Content

What's hot

09 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_1309 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_13Niit Care
 
13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19Niit Care
 
02 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_0202 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_02Niit Care
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusingumlAPU
 
Oop04 6
Oop04 6Oop04 6
Oop04 6schwaa
 
Aae oop xp_07
Aae oop xp_07Aae oop xp_07
Aae oop xp_07Niit Care
 
03 iec t1_s1_plt_session_03
03 iec t1_s1_plt_session_0303 iec t1_s1_plt_session_03
03 iec t1_s1_plt_session_03Niit Care
 
Oop02 6
Oop02 6Oop02 6
Oop02 6schwaa
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of PatternsChris Eargle
 
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Shinpei Hayashi
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsShinpei Hayashi
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocationRiccardo Cardin
 
BIT204 1 Software Fundamentals
BIT204 1 Software FundamentalsBIT204 1 Software Fundamentals
BIT204 1 Software FundamentalsJames Uren
 
A Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationA Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationCoen De Roover
 
C programming session 08
C programming session 08C programming session 08
C programming session 08AjayBahoriya
 
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...Coen De Roover
 

What's hot (20)

09 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_1309 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_13
 
13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19
 
02 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_0202 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_02
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusinguml
 
Oop04 6
Oop04 6Oop04 6
Oop04 6
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
Aae oop xp_07
Aae oop xp_07Aae oop xp_07
Aae oop xp_07
 
03 iec t1_s1_plt_session_03
03 iec t1_s1_plt_session_0303 iec t1_s1_plt_session_03
03 iec t1_s1_plt_session_03
 
Oop02 6
Oop02 6Oop02 6
Oop02 6
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of Patterns
 
How To Code in C#
How To Code in C#How To Code in C#
How To Code in C#
 
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature Implementations
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocation
 
BIT204 1 Software Fundamentals
BIT204 1 Software FundamentalsBIT204 1 Software Fundamentals
BIT204 1 Software Fundamentals
 
Qno 2 (a)
Qno 2 (a)Qno 2 (a)
Qno 2 (a)
 
A Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationA Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X Transformation
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
 

Viewers also liked

02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02Pooja Gupta
 
01 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_0101 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_01Niit Care
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02Niit Care
 
C# Advanced L04-Threading
C# Advanced L04-ThreadingC# Advanced L04-Threading
C# Advanced L04-ThreadingMohammad Shaker
 
Intro To .Net Threads
Intro To .Net ThreadsIntro To .Net Threads
Intro To .Net Threadsrchakra
 
Threading in c#
Threading in c#Threading in c#
Threading in c#gohsiauken
 

Viewers also liked (8)

02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
 
01 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_0101 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_01
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
 
C# Advanced L04-Threading
C# Advanced L04-ThreadingC# Advanced L04-Threading
C# Advanced L04-Threading
 
Threads c sharp
Threads c sharpThreads c sharp
Threads c sharp
 
Intro To .Net Threads
Intro To .Net ThreadsIntro To .Net Threads
Intro To .Net Threads
 
Threading in C#
Threading in C#Threading in C#
Threading in C#
 
Threading in c#
Threading in c#Threading in c#
Threading in c#
 

Similar to 05 iec t1_s1_oo_ps_session_07

C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)Dushmanta Nath
 
C programming session 01
C programming session 01C programming session 01
C programming session 01AjayBahoriya
 
C programming session 05
C programming session 05C programming session 05
C programming session 05AjayBahoriya
 
C programming session 13
C programming session 13C programming session 13
C programming session 13AjayBahoriya
 
C programming session 05
C programming session 05C programming session 05
C programming session 05Vivek Singh
 
Aae oop xp_02
Aae oop xp_02Aae oop xp_02
Aae oop xp_02Niit Care
 
C programming session 13
C programming session 13C programming session 13
C programming session 13Vivek Singh
 
Net framework session01
Net framework session01Net framework session01
Net framework session01Niit Care
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
 
New Features in Dotnet Niku Software
New Features in Dotnet Niku SoftwareNew Features in Dotnet Niku Software
New Features in Dotnet Niku SoftwareJaganathRao
 
C programming session 07
C programming session 07C programming session 07
C programming session 07Vivek Singh
 
Introduction to C3.net Architecture unit
Introduction to C3.net Architecture unitIntroduction to C3.net Architecture unit
Introduction to C3.net Architecture unitKotresh Munavallimatt
 
2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)Shoaib Ghachi
 

Similar to 05 iec t1_s1_oo_ps_session_07 (20)

C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
 
C programming session 13
C programming session 13C programming session 13
C programming session 13
 
C# note
C# noteC# note
C# note
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
 
C# Unit 1 notes
C# Unit 1 notesC# Unit 1 notes
C# Unit 1 notes
 
C Course Material0209
C Course Material0209C Course Material0209
C Course Material0209
 
Aae oop xp_02
Aae oop xp_02Aae oop xp_02
Aae oop xp_02
 
C programming session 13
C programming session 13C programming session 13
C programming session 13
 
Net framework session01
Net framework session01Net framework session01
Net framework session01
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
C++ basics
C++ basicsC++ basics
C++ basics
 
201005 accelerometer and core Location
201005 accelerometer and core Location201005 accelerometer and core Location
201005 accelerometer and core Location
 
New Features in Dotnet Niku Software
New Features in Dotnet Niku SoftwareNew Features in Dotnet Niku Software
New Features in Dotnet Niku Software
 
C programming session 07
C programming session 07C programming session 07
C programming session 07
 
Introduction to C3.net Architecture unit
Introduction to C3.net Architecture unitIntroduction to C3.net Architecture unit
Introduction to C3.net Architecture unit
 
2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)
 
Input output
Input outputInput output
Input output
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
 

More from Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 

Recently uploaded

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Women in Automation 2024: Career session - explore career paths in automation
Women in Automation 2024: Career session - explore career paths in automationWomen in Automation 2024: Career session - explore career paths in automation
Women in Automation 2024: Career session - explore career paths in automationDianaGray10
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Automation Ops Series: Session 3 - Solutions management
Automation Ops Series: Session 3 - Solutions managementAutomation Ops Series: Session 3 - Solutions management
Automation Ops Series: Session 3 - Solutions managementDianaGray10
 
Deliver Latency Free Customer Experience
Deliver Latency Free Customer ExperienceDeliver Latency Free Customer Experience
Deliver Latency Free Customer ExperienceOpsTree solutions
 
Dynamical Context introduction word sensibility orientation
Dynamical Context introduction word sensibility orientationDynamical Context introduction word sensibility orientation
Dynamical Context introduction word sensibility orientationBuild Intuit
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Introduction-to-Wazuh-and-its-integration.pptx
Introduction-to-Wazuh-and-its-integration.pptxIntroduction-to-Wazuh-and-its-integration.pptx
Introduction-to-Wazuh-and-its-integration.pptxmprakaash5
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfHCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfROWELL MARQUINA
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Software Security in the Real World w/Kelsey Hightower
Software Security in the Real World w/Kelsey HightowerSoftware Security in the Real World w/Kelsey Hightower
Software Security in the Real World w/Kelsey HightowerAnchore
 
A PowerPoint Presentation on Vikram Lander pptx
A PowerPoint Presentation on Vikram Lander pptxA PowerPoint Presentation on Vikram Lander pptx
A PowerPoint Presentation on Vikram Lander pptxatharvdev2010
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Recently uploaded (20)

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Women in Automation 2024: Career session - explore career paths in automation
Women in Automation 2024: Career session - explore career paths in automationWomen in Automation 2024: Career session - explore career paths in automation
Women in Automation 2024: Career session - explore career paths in automation
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Automation Ops Series: Session 3 - Solutions management
Automation Ops Series: Session 3 - Solutions managementAutomation Ops Series: Session 3 - Solutions management
Automation Ops Series: Session 3 - Solutions management
 
Deliver Latency Free Customer Experience
Deliver Latency Free Customer ExperienceDeliver Latency Free Customer Experience
Deliver Latency Free Customer Experience
 
Dynamical Context introduction word sensibility orientation
Dynamical Context introduction word sensibility orientationDynamical Context introduction word sensibility orientation
Dynamical Context introduction word sensibility orientation
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Introduction-to-Wazuh-and-its-integration.pptx
Introduction-to-Wazuh-and-its-integration.pptxIntroduction-to-Wazuh-and-its-integration.pptx
Introduction-to-Wazuh-and-its-integration.pptx
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfHCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Software Security in the Real World w/Kelsey Hightower
Software Security in the Real World w/Kelsey HightowerSoftware Security in the Real World w/Kelsey Hightower
Software Security in the Real World w/Kelsey Hightower
 
A PowerPoint Presentation on Vikram Lander pptx
A PowerPoint Presentation on Vikram Lander pptxA PowerPoint Presentation on Vikram Lander pptx
A PowerPoint Presentation on Vikram Lander pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

05 iec t1_s1_oo_ps_session_07

  • 1. Object-Oriented Programming Using C# Objectives In this session, you will learn to: Describe memory allocation Use structure Use enumerations Implement arrays Use collections Ver. 1.0 Session 7 Slide 1 of 32
  • 2. Object-Oriented Programming Using C# Describing Memory Allocation The memory allocated to variables is referred to in the following ways: – Value types: Contains data. Built-in data types, such as int, char, and float are value types. – Reference types: Contains address referring to a block of memory. Data types, such as string and class are reference types. Let us understand the concept of memory allocation in detail. Ver. 1.0 Session 7 Slide 2 of 32
  • 3. Object-Oriented Programming Using C# Describing Memory Allocation (Contd.) Value Type: int Num1; Variable Declaration Num1=50; Num1 Initialization 50 Both Num1 and Num2 Contain 50 Num2 50 int Num2; Variable Declaration Num2=Num1; Initializing Num2 with Num1 Ver. 1.0 Session 7 Slide 3 of 32
  • 4. Object-Oriented Programming Using C# Describing Memory Allocation (Contd.) Value Type (Contd.): Num1 New Value Assigned to Num1 Num1=60; 60 The Value of Num2 Remains Unaffected Num2 50 Ver. 1.0 Session 7 Slide 4 of 32
  • 5. Object-Oriented Programming Using C# Describing Memory Allocation (Contd.) Reference Type: Car Suzuki= new Car(); Object of Class Car() Suzuki.Model=10; Initialization Member Variable of Class Car() Car Mercedes; Object of Class Car() Mercedes=Suzuki; Initializing Mercedes with Suzuki Ver. 1.0 Session 7 Slide 5 of 32
  • 6. Object-Oriented Programming Using C# Describing Memory Allocation (Contd.) Reference Type (Contd.): Suzuki Referring to Memory *** Location Where the Data is Stored 10 Mercedes Referring to Memory *** Location Where the Data is Stored Ver. 1.0 Session 7 Slide 6 of 32
  • 7. Object-Oriented Programming Using C# Using Structure • A structure is a value type data type. • When you want a single variable to hold related data of various data types, you can create a structure. • To create a structure you use the struct keyword. • The following code shows the example of a declaring a structure names Bill_Details: struct Bill_Details { public string inv_No; // Invoice Number string ord_Dt; // Order Date string custName; // Customer name Ver. 1.0 Session 7 Slide 7 of 32
  • 8. Object-Oriented Programming Using C# Using Structure (Contd.) public string product; // Product Name public double cost; // Cost of the product public double due_Amt; // Total amount due } Ver. 1.0 Session 7 Slide 8 of 32
  • 9. Object-Oriented Programming Using C# Using Enumeration • Enumeration is a value type data type. • Enumeration contains its own values and cannot inherit or pass inheritance. • Enumerators allows you to assign symbolic names to integral constants. • To enumerate, you can use the enum keyword. Ver. 1.0 Session 7 Slide 9 of 32
  • 10. Object-Oriented Programming Using C# Declaring an Enumeration • The following code is an example of declaring an enumeration named Days: enum Days { Sat, Sun, Mon, Tue, Wed, Thu, Fri }; Ver. 1.0 Session 7 Slide 10 of 32
  • 11. Object-Oriented Programming Using C# Implementing Enumerations After declaring the enumeration type, you can use the enumeration type in the same manner as any other data type: int First_Day = (int)Days.Sat; int Last_Day = (int)Days.Fri; Ver. 1.0 Session 7 Slide 11 of 32
  • 12. Object-Oriented Programming Using C# Implementing Arrays An array is a collection of values of the same data type. The following figure shows the array structure in the system’s memory. Index Index Value 0 Value 6 Ver. 1.0 Session 7 Slide 12 of 32
  • 13. Object-Oriented Programming Using C# Declaring an Array An array needs to be declared before it can be used in a program. You can declare an array by using the following statement: datatype[] Arrayname; Let us understand the explanation of the various elements of the array declaration through an example. Ver. 1.0 Session 7 Slide 13 of 32
  • 14. Object-Oriented Programming Using C# Declaring an Array (Contd.) int[ ] Score; Datatype Is used to specify the data type for the elements Ver. 1.0 Session 7 Slide 14 of 32
  • 15. Object-Oriented Programming Using C# Declaring an Array (Contd.) int[ ] Score; [] Is used to specify the rank of the array Ver. 1.0 Session 7 Slide 15 of 32
  • 16. Object-Oriented Programming Using C# Declaring an Array (Contd.) int[ ] Score; Arrayname Is used to specify the name of the array using which the elements of the array will be initialized and manipulated Ver. 1.0 Session 7 Slide 16 of 32
  • 17. Object-Oriented Programming Using C# Initializing and Assigning Values to Array • In C#, you can initialize the array variable and can assign values to the array elements. In addition, you can copy the array variable to another variable. • During initialization, you need to use the new keyword to create an instance of the array. In addition, the size of the array is also specified while it is initialized. • The following is an example of array initialization: int[] Score; // Array declaration Score = new int[10]; //Array Instance Ver. 1.0 Session 7 Slide 17 of 32
  • 18. Object-Oriented Programming Using C# Initializing and Assigning Values to Array (Contd.) You can assign values to each element of the array by using the index number, which is called the array subscript of the element. The following is an example of assigning values to the array: int[] Score = new int[3]; Score[0]=10; Or int[] Score={5,10,15}; When you copy the array variable, both the source and target variable refer to the same array instance in the memory. The following is an example of copying the array variables: int[] Source = new int[10] {0, 1, 2, 3, 4}; int[] Target= Source; Ver. 1.0 Session 7 Slide 18 of 32
  • 19. Object-Oriented Programming Using C# Manipulating Array Elements • When an array is initialized, you can access the element values and manipulate them. • The foreach loop is specially used for manipulating arrays. • The following is the syntax of the foreach loop: foreach (type identifier in expression) { //statements } Ver. 1.0 Session 7 Slide 19 of 32
  • 20. Object-Oriented Programming Using C# Manipulating Array Elements (Contd.) • The following is the example of foreach loop: int[] Numbers = { 4, 3, 2, 1, 0, -1, -2, 9, 5 }; Console.WriteLine("The Contents of an Array is:"); foreach (int K in Numbers) { Console.WriteLine("{0} t",K); } Ver. 1.0 Session 7 Slide 20 of 32
  • 21. Object-Oriented Programming Using C# Manipulating Array Elements (Contd.) • While declaring a method if you are not sure about the number of arguments passed as a parameter, you can use the param array. • The following is the example of param array: public int Adding_ArrayElement(params int[] List) { int Total = 0; foreach ( int I in List ) { Total += I; } return Total; } Ver. 1.0 Session 7 Slide 21 of 32
  • 22. Object-Oriented Programming Using C# Demo: Matrix Subtraction Using Arrays Problem Statement: David, a student of California University, is currently pursuing mathematics. He is working on a project named Matrix Subtraction. He needs to perform the following tasks for his project: • Accept data in two Arrays. • Perform the subtraction operation. • Verify the value of subtraction. Help David to create the C# program using Visual Studio IDE. Ver. 1.0 Session 7 Slide 22 of 32
  • 23. Object-Oriented Programming Using C# Demo: Matrix Subtraction Using Arrays (Contd.) Solution: To solve the preceding problem, David needs to perform the following tasks: 1. Create a console-based application for Matrix Subtraction. 2. Build and execute an application. Ver. 1.0 Session 7 Slide 23 of 32
  • 24. Object-Oriented Programming Using C# Multidimensional Arrays The rank value of the array is also known as the dimension of the array. The array can be single dimensional or multidimensional. Single dimensional array stores data in a row. Multidimensional array stores data using different dimensions. The following figure is a graphical representation of values stored in a single dimensional array and a multidimensional array. int [] Num; int[,] Num; 0 0 1 2 3 4 1 0 1 2 3 4 Ver. 1.0 Session 7 Slide 24 of 32
  • 25. Object-Oriented Programming Using C# Multidimensional Arrays (Contd.) • The Array class is the base class for all the arrays in C#. • The Array class provides properties and methods to work with arrays. – Properties: The following table explains some of the most commonly used properties of the Array class. Properties Explanation Length Returns the total number of items in all the dimensions of an array Rank Returns the total number of items in all the dimensions of an array IsFixedSize Return a value indicating if an array has a fixed size or not IsReadOnly Returns a value indicating if an array is read-only or not Ver. 1.0 Session 7 Slide 25 of 32
  • 26. Object-Oriented Programming Using C# Multidimensional Arrays (Contd.) – Methods: The following table explains some of the most commonly used methods of the Array class. Properties Explanation Sort Performs sort operation on an array passed to it as a parameter Clear Removes all items of an array and sets a range of items in the array to 0 GetLength Returns the number of items in an Array GetValue Returns the value of the specified item in an Array IndexOf Returns the index of the first occurrence of a value in a one-dimensional Array or in a portion of the Array Ver. 1.0 Session 7 Slide 26 of 32
  • 27. Object-Oriented Programming Using C# Using Collections • Arrays are used to collect the elements of same data type. • The .NET Framework provides several classes that also collect elements in specialized ways. Theses classes are the Collection classes, and are declared in the System.Collections namespace and sub-namespaces. Ver. 1.0 Session 7 Slide 27 of 32
  • 28. Object-Oriented Programming Using C# Using Collections (Contd.) • The collection classes accept, hold, and return their elements as items. • The element type of collection class is an object. Object is a reference type. • The following figure shows the storage of values in array of type int: STACK HEAP Array @ 9 7 3 2 int [] array= {9, 7, 3, 2}; Ver. 1.0 Session 7 Slide 28 of 32
  • 29. Object-Oriented Programming Using C# Using Collections (Contd.) The action which automatically converts the value type to the reference type, is known as boxing. The following figure shows the boxing technique. STACK HEAP 7 2 Array @ @ @ @ @ 9 3 int [] array= {9, 7, 3, 2}; Ver. 1.0 Session 7 Slide 29 of 32
  • 30. Object-Oriented Programming Using C# Using Collections (Contd.) • When you want to access the elements of an array through its index value location in an array, use an ArrayList class. • The following table describes the use of various methods of an ArrayList class. Method Use Add Adds an object to the end of the ArrayList Remove Removes the element at the first occurrence of a specific object from the ArrayList Clear Removes all the elements from the ArrayList Insert Inserts an element into the ArrayList at the specified index TrimToSize Sets the capacity to the actual number of elements in the ArrayList Sort Sorts the elements in the ArrayList Reverse Reverses the element in the ArrayList Ver. 1.0 Session 7 Slide 30 of 32
  • 31. Object-Oriented Programming Using C# Summary In this session, you learned that: – Memory allocated to variables are of two types, value type and reference type. – Value-types are the simplest types in C#. Variables of value types directly contain their data in the variable. – Reference-types variables contain only a reference to data. The data is stored in a separate memory area. – A value type variable holds its value in the stack. – A reference type variable holds a reference to an object in the heap. – To hold related data of various data type in single variable, structures are used. – C# provides the features of enum to create user defined data types with numbers as an index value to access them. – An array is a collection of values of the same data type. Ver. 1.0 Session 7 Slide 31 of 32
  • 32. Object-Oriented Programming Using C# Summary (Contd.) – The foreach statement interprets the common loop process and removes the need for you to check the array size. – Param arrays are used in the methods with parameter list when the total number of parameters is not known. – The .NET Framework provides several classes that also collect elements together in other specialized ways. These are the Collection classes, and they live in the System namespace. – ArrayList is useful when you want to manipulate the values in an array easily. Ver. 1.0 Session 7 Slide 32 of 32

Editor's Notes

  1. Students have learnt the structure of different types of dimensions and the importance of surrogate keys in Module I. In this session, students will learn to load the data into the dimension tables after the data has been transformed in the transformation phase. In addition, students will also learn to update data into these dimension tables. Students already know about different types of dimension tables. Therefore, you can start the session by recapitulating the concepts. Initiate the class by asking the following questions: 1. What are the different types of dimensions? 2. Define flat dimension. 3. What are conformed dimension? 4. Define large dimension. 5. Define small dimension. 6. What is the importance of surrogate key in a dimension table? Students will learn the loading and update strategies theoretically in this session. The demonstration to load and update the data in the dimension table will be covered in next session.
  2. Students know the importance of surrogate keys. In this session students will learn the strategy to generate the surrogate key. Give an example to explain the strategy to generate the surrogate keys by concatenating the primary key of the source table with the date stamp. For example, data from a Product table has to be loaded into the Product_Dim dimension table on Feb 09, 2006. The product_code is the primary key column in the Product table. To insert the surrogate key values before loading the data into the dimension table, you can combine the primary key value with the date on which the data has to be loaded. In this case the surrogate key value can be product_code+09022006.
  3. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  4. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  5. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  6. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  7. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  8. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  9. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  10. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  11. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  12. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  13. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  14. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  15. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  16. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  17. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  18. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  19. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  20. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  21. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  22. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  23. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  24. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  25. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  26. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  27. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.
  28. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.