6: Arrays and Collections

Size: px
Start display at page:

Download "6: Arrays and Collections"

Transcription

1 6: Arrays and Collections Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1)

2 Course Outline Day 1: Morning Introduction to Object-Orientation, Introduction to.net, Overview of.net Framework,.NET Components. C#. Introduction to Visual Studio Environment. Day 1: Afternoon Variables and Types, Naming Variables, Using Built-In Data Types, Visual Studio Environment: Design Surface - dynamic help; Toolbox; Code Page; Properties Window; Solution Explorer. Day 2: Morning Converting Data Types, Control structures: if, for, while, foreach, switch. Day 2: Afternoon File handling looking up details from help, Methods, Parameter passing, Variables and scope. Day 3: Morning REVIEW OF BASICS FROM DAY 2, Converting Data Types, Control structures: if, for, while, foreach, switch. Day 3: Afternoon Brief description of Arrays, Type Casts, Overview of System.Collections, ArrayLists and HashTables, Sorting, Enumerators Course Outline (Day 1 to 3) W.Buchanan (2)

3 Course Outline Day 4: Morning Using Reference-Type Variables, Using Common Reference Types, The Object Hierarchy, Namespaces in the.net Framework, Debugging techniques, breakpoints, line stepping, call stack, locals window. Day 4: Afternoon - Classes and Objects, Using Encapsulation, C# and Object Orientation, Defining Object-Oriented Systems, Deriving classes, Implementing classes, Private, public, internal and protected, Using Interfaces, Abstract classes, Using Constructors Initializing Data, Objects and Memory, Resource Management, Object Browser, Class View. Day 5: Morning - Methods and overloaded methods, Exceptions, Intellisense and overloaded methods, Enumerations and string enumeration conversion. Day 5: Afternoon: Using Modules and Assemblies, XML (read only), Serialising classes. Course Outline (Day 4 and 5) W.Buchanan (3)

4 Module 6 Arrays. Reading from CSV files. System.Collections. ArrayLists. HashTables. Introduction W.Buchanan (4)

5 Arrays W.Buchanan (5)

6 System.Array object: Methods include: BinarySearch() Clear() Clone() Copy() CopyTo() CreateInstance() GetLength() IndexOf() Initialize() LastIndexOf() Reverse() SetValue() Sort() IsFixedSize IsReadOnly Length Performs a binary on a one-dimensional array Sets a range of elements to zero, False or NULL. Make a shallow copy of the array. Copies a range of values in an array. Copies one array to another. Create a multidimensional array. Return the number of elements in the array. Search for an object, and return the first index value of its place. Set all the elements in the array to their default value. Returns the last object in the array. Reverses the array. Sets a specific array element to a value. Performs a sort on the array. Identifies if the array is a fixed size (get only) Identifies if the array is read-only (get only) Identifies the length of the array (get only) W.Buchanan (6)

7 Variables ArrayName i j Reference to the start of the array space. Element 0 Element 1 Element 2 k Allocated on the heap. Element 3 Element 4 Element n-2 Element n-1 Variables and Arrays W.Buchanan (7)

8 W.Buchanan (8)

9 C# contains the methods of the System.Array object. It also inherits the syntax of C for representing an array index, which uses square brackets to identify the element, such as: myarray[15]; for the element number 15. Note that C# starts its indexing at 0, thus myarray[15] is the 16th element of the array. To declare an array: type[] arrayname; For example to declare an array of doubles: double[] inputvalues; This declares the type of the array. To then to initialize it the following is used: inputvalues = new double[5]; which creates a new array with 5 elements (0 to 4). ArrayName Element 0 Element 1 Element 2 Element 3 Element 4 Element n-2 Element n-1 W.Buchanan (9)

10 namespace ConsoleApplication2 class ArrayExample01 static void getvalues(double[] v) int i; for (i=0;i<v.length;i++) System.Console.Write("Value >> "); v[i]=convert.todouble(system.console.readline()); static double average(double[] v) double total=0; int i; for (i=0;i<v.length;i++) total+=v[i]; return(total/v.length); static void Main(string[] args) int i; double[] inputvalues; double av; inputvalues = new double[5]; getvalues(inputvalues); av=average(inputvalues); System.Console.WriteLine("Average is 0",av); System.Console.ReadLine(); W.Buchanan (10)

11 Note that the declaration of the array type does not actually create the array, and the line: double[] inputvalues; double av av=inputvalues[0]; will cause a build error of: Use of unassigned local variable 'inputvalues' As the array can not been created yet, and just contains a null value. Using an array W.Buchanan (11)

12 The arrays when they are initialized are set to a default value, such as zero for numeric data types, and null for strings. To initialise it with actual values, the required values are contained within curly brackets, such as: double[] vals = 1.2,1.4,1.6,1.8,2.0; string[] menuitems = "File", "Edit", "View", "Insert", "Tool", "Table"; This performs both the declaration of the array and its initialization. Program 3.2 shows an example of the declaration of an array of strings. W.Buchanan (12)

13 using System; namespace ConsoleApplication2 class ArrayExample01 static void Main(string[] args) int i; string[] ColourBands="BLACK","BROWN","RED","ORANGE","YELLOW", "GREEN"; for (i=0;i<colourbands.length;i++) System.Console.WriteLine("0 is 1",i,ColourBands[i]); System.Console.ReadLine(); W.Buchanan (13)

14 using System; namespace ConsoleApplication2 class ArrayExample01 static double findsmallest(double[] v) double smallest; smallest=v[0]; for (int i=1; i<v.length; i++) if (v[i]<smallest) smallest = v[i]; return(smallest); static void Main(string[] args) int i; double[] vals = 1.2,4.5,13.3,10.1,-4.3,52.5,6.2; double smallest; smallest= findsmallest(vals); System.Console.WriteLine("Smallest value is 0",smallest); System.Console.ReadLine(); W.Buchanan (14)

15 foreach W.Buchanan (15)

16 foreach (type identifier in expression) statement Thus: for (i=0;i<colourbands.length;i++) System.Console.WriteLine("0 is 1",i,ColourBands[i]); is replaced by (Program3_3_ArrayInitializationNumericForEach): foreach (string band in ColourBands) System.Console.WriteLine("0",band); For the example in Program 3.2 we can replace: for (int i=1; i<v.length; i++) if (v[i]<smallest) smallest = v[i]; with (Program3_4_ArrayInitializationStringsForEach): foreach (double val in v) if (val<smallest) smallest = val; foreach W.Buchanan (16)

17 using System; namespace ConsoleApplication2 class ArrayExample01 static double findsmallest(double[] v) double smallest; smallest=v[0]; foreach (double val in v) if (val<smallest) smallest = val; return(smallest); static void Main(string[] args) int i; double[] vals = 1.2,4.5,13.3,10.1,-4.3,52.5,6.2; double smallest; smallest= findsmallest(vals); System.Console.WriteLine("Smallest value is 0",smallest); System.Console.ReadLine(); W.Buchanan (17)

18 Tutorial Session 6.1: Q6.1 to Q6.4 Presentations Notes SourceCode Tutorials W.Buchanan (18)

19 namespace solution6_04 class Class1 static void finderror(double[] a1, double[] a2, double[] a3) for (int i=0; i<a1.length; i++) a3[i]=a1[i]-a2[i]; static void Main(string[] args) double[] array01 = 3, 3.1, 4.3, 5.5, 6.7, 5.4, 3.1, 4.4; double[] array02 = 3.1, 3.3, 4.1, 6.5, 6.65, 5.21, 3.11, 4. double[] array03 = 0,0,0,0,0,0,0,0; finderror(array01, array02, array03); for (int i=0;i<array03.length;i++) System.Console.WriteLine("0\t1\t2", array01[i],array02[i],array03[i]); System.Console.ReadLine(); W.Buchanan (19)

20 Reading CSV Data W.Buchanan (20)

21 1,5,6,7,4,5,6,7,10,5,4,3,2,1 For this we can read the file one line at a time, and then split the string using the Split() method. This can be contained with the foreach statement, to parse each part of the split text. The code which fills the array v is: do text=reader.readline(); if (text==null) break; foreach (string substring in text.split(',')) v[i]=convert.todouble(substring); i++; while (text!= null); Reading a CSV file W.Buchanan (21)

22 class ArrayExample02 const int ARRAYLIMIT=100; static void filldata(double[] v) int i=0; FileInfo thesourcefile = new FileInfo("..\\..\\test.csv"); StreamReader reader = thesourcefile.opentext(); string text; do text=reader.readline(); if (text==null) break; foreach (string substring in text.split(',')) v[i]=convert.todouble(substring); i++; while (text!= null); reader.close(); W.Buchanan (22)

23 Often the CSV file is organised into rows with comma separated variables in each row. This is similar to a spreadsheet where the row is represented by a line, and the columns are delimited by commas. For example: Fred,20 Bert,10 Colin,15 Berty,26 Freddy,22 We can then modify the reading method to parse the input line from the CSV file: do text=reader.readline(); if (text==null) break; string[] str =text.split(','); name[i]=str[0]; age[i]=convert.toint32(str[1]); i++; while (text!= null); CSV W.Buchanan (23)

24 Tutorial Session 5.2: Q6.5 to Q6.7 Presentations Notes SourceCode Tutorials W.Buchanan (24)

25 Collections W.Buchanan (25)

26 System.Collections ArrayList BitArray CaseInsensitiveComparer CaseInsensitiveHashCodeProvider CollectionBase Comparer DictionaryBase DictionaryEntry Hashtable Queue ReadOnlyCollectionBase SortedList Stack W.Buchanan (26)

27 ArrayLists W.Buchanan (27)

28 System.Array object: Methods include: BinarySearch() Clear() Clone() Copy() CopyTo() CreateInstance() GetLength() IndexOf() Initialize() LastIndexOf() Reverse() SetValue() Sort() IsFixedSize IsReadOnly Length Performs a binary on a one-dimensional array Sets a range of elements to zero, False or NULL. Make a shallow copy of the array. Copies a range of values in an array. Copies one array to another. Create a multidimensional array. Return the number of elements in the array. Search for an object, and return the first index value of its place. Set all the elements in the array to their default value. Returns the last object in the array. Reverses the array. Sets a specific array element to a value. Performs a sort on the array. Identifies if the array is a fixed size (get only) Identifies if the array is read-only (get only) Identifies the length of the array (get only) W.Buchanan (28)

29 using System; using System.Collections; namespace ConsoleApplication2 class Class1 static void Main(string[] args) ArrayList a = new ArrayList(); a.add("arnold"); a.add("smith"); a.add("cordiner"); a.add("mitchel"); a.sort(); foreach (string nam in a) System.Console.WriteLine("0",nam); System.Console.ReadLine(); W.Buchanan (29)

30 namespace ConsoleApplication2 using System; using System.Collections; // required for ArrayList using System.IO; // required for File I/O class ArrayExample02 static void filldata(arraylist v) int i=0; FileInfo thesourcefile = new FileInfo("..\\..\\test.csv"); StreamReader reader = thesourcefile.opentext(); string text; do text=reader.readline(); if (text==null) break; foreach (string substring in text.split(',')) v.add(convert.todouble(substring)); i++; while (text!= null); reader.close(); W.Buchanan (30)

31 static void showdata(arraylist v) int i; for (i=0;i<v.count;i++) Console.WriteLine("0 1",i,v[i]); static void Main(string[] args) ArrayList Vals = new ArrayList(); filldata(vals); showdata(vals); System.Console.ReadLine(); W.Buchanan (31)

32 static void showdata(arraylist v) 0 1 int i; 1 5 for (i=0;i<v.count;i++) 2 6 Console.WriteLine("0 1",i,v[i]); static void Main(string[] args) ArrayList Vals = new ArrayList(); filldata(vals); showdata(vals); System.Console.ReadLine(); W.Buchanan (32)

33 namespace ConsoleApplication2 using System; using System.Collections; // required for ArrayList using System.IO; // required for File I/O class ArrayExample02 static void filldata(arraylist v) int i=0; FileInfo thesourcefile = new FileInfo("..\\..\\test.csv"); StreamReader reader = thesourcefile.opentext(); string text; do text=reader.readline(); if (text==null) break; foreach (string substring in text.split(',')) v.add(convert.todouble(substring)); i++; while (text!= null); reader.close(); W.Buchanan (33)

34 static void showdata(arraylist v) for (int i=0;i<v.count;i++) Console.WriteLine("0 1",i,v[i]); static double findaverage(arraylist v) double total=0; for (int i=0;i<v.count;i++) total+=convert.todouble(v[i]); return(total/v.count); static void Main(string[] args) ArrayList Vals = new ArrayList(); double average; filldata(vals); average=findaverage(vals); System.Console.WriteLine("Average is 0",average); System.Console.ReadLine(); W.Buchanan (34)

35 namespace ConsoleApplication2 using System; using System.Collections; // required for ArrayList using System.IO; // required for File I/O class ArrayExample02 static void filldata(arraylist v) int i=0; FileInfo thesourcefile = new FileInfo("..\\..\\test.csv"); StreamReader reader = thesourcefile.opentext(); string text; do text=reader.readline(); if (text==null) break; v.add(text); while (text!= null); reader.close(); W.Buchanan (35)

36 static void showdata(arraylist v) int i; for (i=0;i<v.count;i++) Console.WriteLine("0 1",i,v[i]); static void Main(string[] args) ArrayList Vals = new ArrayList(); filldata(vals); showdata(vals); Vals.Sort(); showdata(vals); System.Console.ReadLine(); W.Buchanan (36)

37 static void showdata(arraylist v) int i; for (i=0;i<v.count;i++) Console.WriteLine("0 1",i,v[i]); static void Main(string[] args) ArrayList Vals = new ArrayList(); filldata(vals); showdata(vals); Vals.Sort(); showdata(vals); System.Console.ReadLine(); 0 Smith,Fred 1 Bell,Bert 2 McDonald,Rory 3 Mitchel,Brian 4 Barr,Martin 5 Kinlock,Graha 0 Barr,Martin 1 Bell,Bert 2 Kinlock,Graha 3 McDonald,Rory 4 Mitchel,Brian 5 Smith,Fred W.Buchanan (37)

38 Tutorial Session 5.2: Q6.8 to Q6.9 Presentations Notes SourceCode Tutorials W.Buchanan (38)

39 HashTables # W.Buchanan (39)

40 HashTables represents a collection of key-and-value pairs that are organized based on the hash code of the key. They are particularly useful for fast retrieval of data from a list. They are basically dictionaries of data. Array HashTable 0 Fred Smith AB01 Fred Smith Bert Smith Fred Jones Sally Smith Andy Forbes CD01 DE02 AB02 DE02 Bert Smith Fred Jones Sally Smith Andy Forbes W.Buchanan (40)

41 Add(object,object) Adds elements with a specified key and value into the Hashtable. Clear() Removes the elements in Hashtable. Clone() Creates a shallow copy of the Hashtable. Contains(object) Determines whether the Hashtable contains a certain key. ContainsValue(object) Determines whether the Hashtable contains a certain value. CopyTo(System.Array,int) Copies a parts of a Hashtable to a one-dimensional Array instance. GetEnumerator() Returns an enumerator value that can iterate through the Hashtable. W.Buchanan (41)

42 GetHash(object) Returns the hash code for the specified key. Hashtable(int) Create a empty Hashtable. Hashtable() Creates an empty Hashtable. KeyEquals(object,object) Compares an object with the key. Remove(object) Removes the element with the specified key from the Hashtable. W.Buchanan (42)

43 using System; using System.Collections; namespace ConsoleApplication1 class Class1 static void Main(string[] args) Hashtable h = new Hashtable(); Name:Fred Smith Name:Bert Smith Name:Fred Jones h.add("a000","fred Smith"); h.add("b111","bert Smith"); h.add("c232","fred Jones"); System.Console.WriteLine("Name:0",h["A000"]); System.Console.WriteLine("Name:0",h["B111"]); System.Console.WriteLine("Name:0",h["C232"]); System.Console.ReadLine(); W.Buchanan (43)

44 using System; using System.Collections; namespace ConsoleApplication1 class Class1 static void Main(string[] args) Hashtable h = new Hashtable(); Name: Name: Name: h.add("a000","fred Smith"); h.add("b111","bert Smith"); h.add("c232","fred Jones"); h.clear(); System.Console.WriteLine("Name:0",h["A000"]); System.Console.WriteLine("Name:0",h["B111"]); System.Console.WriteLine("Name:0",h["C232"]); System.Console.ReadLine(); W.Buchanan (44)

45 The Hashtable uses a similar technique to add data to its list (with the Add() method). Once the table has been filled, the keys from the table can be generated from (using a Hashtable of v): ICollection keys = v.keys; And the values in the list by: ICollection values = v.values; W.Buchanan (45)

46 using System; using System.Collections; namespace ConsoleApplication1 class Class1 static void Main(string[] args) Hashtable h = new Hashtable(); h.add("a000","fred Smith"); h.add("b111","bert Smith"); h.add("c232","fred Jones"); ICollection keys = h.keys; ICollection values = h.values; System.Console.WriteLine("Keys are: "); foreach (string key in keys) Console.WriteLine("0",key); System.Console.WriteLine("Values are: "); foreach (string val in values) Console.WriteLine("0",val); System.Console.ReadLine(); W.Buchanan (46)

47 using System; using System.Collections; namespace ConsoleApplication1 class Class1 static void Main(string[] args) Hashtable h = new Hashtable(); h.add("a000","fred Smith"); h.add("b111","bert Smith"); h.add("c232","fred Jones"); ICollection keys = h.keys; ICollection values = h.values; System.Console.WriteLine("Keys are: "); foreach (string key in keys) Console.WriteLine("0",key); System.Console.WriteLine("Values are: "); foreach (string val in values) Console.WriteLine("0",val); System.Console.ReadLine(); Keys are: C232 A000 B111 Values are: Fred Jones Fred Smith Bert Smith W.Buchanan (47)

48 static void showdata(hashtable v) int i; ICollection keys = v.keys; ICollection values = v.values; System.Console.WriteLine("Keys are: "); foreach (string key in keys) Console.WriteLine("0",key); System.Console.WriteLine("Values are: "); foreach (string val in values) Console.WriteLine("0",val); W.Buchanan (48)

49 It is possible to browse through the dictionary by creating an enumerator (using the GetEnumerator() method). This creates a list of references to the elements in the hashtable. This is achieved with the following (for a hashtable of v): System.Collections.IDictionaryEnumerator enumerator = v.getenumerator(); while (enumerator.movenext()) Console.WriteLine("0 1",enumerator.Key, enumerator.value); W.Buchanan (49)

50 using System; using System.Collections; namespace ConsoleApplication1 class Class1 static void Main(string[] args) Hashtable h = new Hashtable(); h.add("a000","fred Smith"); h.add("b111","bert Smith"); h.add("c232","fred Jones"); System.Collections.IDictionaryEnumerator enumerator = h.getenumerator(); while (enumerator.movenext()) Console.WriteLine("0 1",enumerator.Key, enumerator.value); System.Console.ReadLine(); W.Buchanan (50)

51 using System; using System.Collections; namespace ConsoleApplication1 class Class1 static void Main(string[] args) Hashtable h = new Hashtable(); C232 Fred Jones A000 Fred Smith B111 Bert Smith h.add("a000","fred Smith"); h.add("b111","bert Smith"); h.add("c232","fred Jones"); System.Collections.IDictionaryEnumerator enumerator = h.getenumerator(); while (enumerator.movenext()) Console.WriteLine("0 1",enumerator.Key, enumerator.value); System.Console.ReadLine(); W.Buchanan (51)

52 Tutorial Session 5.2: Q6.10 to Q6.12 Presentations Notes SourceCode Tutorials W.Buchanan (52)

6: Arrays and Collections

6: Arrays and Collections 6: Arrays and Collections Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline Day 1: Morning Introduction to Object-Orientation, Introduction to.net, Overview of.net Framework,.NET Components.

More information

Module 5: Review of Day 3

Module 5: Review of Day 3 Module 5: Review of Day 3 Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline Day 1: Morning Introduction to Object-Orientation, Introduction to.net, Overview of.net Framework,.NET Components.

More information

Module 5: Review of Day 3

Module 5: Review of Day 3 Module 5: Review of Day 3 Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline Day 1: Morning Introduction to Object-Orientation, Introduction to.net, Overview of.net Framework,.NET Components.

More information

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1) Classes and Objects Andrew Cumming, SoC Introduction to.net Bill Buchanan, SoC W.Buchanan (1) Course Outline Introduction to.net Day 1: Morning Introduction to Object-Orientation, Introduction to.net,

More information

Last Time. Arrays. Arrays. Jagged Arrays. foreach. We began looking at GUI Programming Completed talking about exception handling

Last Time. Arrays. Arrays. Jagged Arrays. foreach. We began looking at GUI Programming Completed talking about exception handling Last Time We began looking at GUI Programming Completed talking about exception handling Arrays, Collections, Hash Tables, 9/22/05 CS360 Windows Programming 1 9/22/05 CS360 Windows Programming 2 Arrays

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 8 : Collections Lecture Contents 2 Why collections? What is a collection? Non-generic collections: Array & ArrayList Stack HashTable

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 7 : Collections Lecture Contents 2 Why collections? What is a collection? Non-generic collections: Array & ArrayList Stack HashTable

More information

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1) Classes and Objects Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline 11-12am 12-1pm: 1-1:45pm 1:45-2pm:, Overview of.net Framework,.NET Components, C#. C# Language Elements Classes,

More information

Arrays, Strings and Collections

Arrays, Strings and Collections Arrays Arrays can be informally defined as a group of variables containing values of the same type and that in some way or another they are related. An array has a fixed size that is defined before the

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 8 : Collections Lecture Contents 2 Why collections? What is a collection? Non-generic collections: Array & ArrayList Stack HashTable

More information

Advanced Computer Programming

Advanced Computer Programming Hazırlayan Yard. Doç. Dr. Mehmet Fidan ARRAYS A group of data with same type stored under one variable. It is assumed that elements in that group are ordered in series. In C# language arrays are has System.Array

More information

Computing is about Data Processing (or "number crunching") Object Oriented Programming is about Cooperating Objects

Computing is about Data Processing (or number crunching) Object Oriented Programming is about Cooperating Objects Computing is about Data Processing (or "number crunching") Object Oriented Programming is about Cooperating Objects C# is fully object-oriented: Everything is an Object: Simple Types, User-Defined Types,

More information

Fall Semester (081) Dr. El-Sayed El-Alfy Computer Science Department King Fahd University of Petroleum and Minerals

Fall Semester (081) Dr. El-Sayed El-Alfy Computer Science Department King Fahd University of Petroleum and Minerals INTERNET PROTOCOLS AND CLIENT-SERVER PROGRAMMING Client SWE344 request Internet response Fall Semester 2008-2009 (081) Server Module 2.1: C# Programming Essentials (Part 1) Dr. El-Sayed El-Alfy Computer

More information

4/29/03 Doc 25 C# Arrays, Indexers & Exceptions slide # 1

4/29/03 Doc 25 C# Arrays, Indexers & Exceptions slide # 1 4/29/03 Doc 25 C# Arrays, Indexers & Exceptions slide # 1 CS 683 Emerging Technologies Spring Semester, 2003 Doc 25 C# Arrays, Indexers & Exceptions Contents Arrays... 2 Aystem.Array... 6 Properties...

More information

Multiple Choice: 2 pts each CS-3020 Exam #3 (CH16-CH21) FORM: EX03:P

Multiple Choice: 2 pts each CS-3020 Exam #3 (CH16-CH21) FORM: EX03:P Multiple Choice: 2 pts each CS-3020 Exam #3 (CH16-CH21) FORM: EX03:P Choose the BEST answer of those given and enter your choice on the Answer Sheet. You may choose multiple options, but the point value

More information

Chapter 6: Using Arrays

Chapter 6: Using Arrays Chapter 6: Using Arrays Declaring an Array and Assigning Values to Array Array Elements A list of data items that all have the same data type and the same name Each item is distinguished from the others

More information

OVERVIEW ENVIRONMENT PROGRAM STRUCTURE BASIC SYNTAX DATA TYPES TYPE CONVERSION

OVERVIEW ENVIRONMENT PROGRAM STRUCTURE BASIC SYNTAX DATA TYPES TYPE CONVERSION Program: C#.Net (Basic with advance) Duration: 50hrs. C#.Net OVERVIEW Strong Programming Features of C# ENVIRONMENT The.Net Framework Integrated Development Environment (IDE) for C# PROGRAM STRUCTURE Creating

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Uka Tarsadia University MCA ( 3rd Semester)/M.Sc.(CA) (1st Semester) Course : / Visual Programming Question Bank

Uka Tarsadia University MCA ( 3rd Semester)/M.Sc.(CA) (1st Semester) Course : / Visual Programming Question Bank Unit 1 Introduction to.net Platform Q: 1 Answer in short. 1. Which three main components are available in.net framework? 2. List any two new features added in.net framework 4.0 which is not available in

More information

Course Hours

Course Hours Programming the.net Framework 4.0/4.5 with C# 5.0 Course 70240 40 Hours Microsoft's.NET Framework presents developers with unprecedented opportunities. From 'geoscalable' web applications to desktop and

More information

9 Hashtables and Dictionaries

9 Hashtables and Dictionaries 9 Hashtables and Dictionaries Chapter 9 Contax T Concrete Stairs HashTables and Dictionaries Learning Objectives Describe the purpose and use of a hashtable Describe the purpose and use of a dictionary

More information

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio Introduction XXV Part I: C# Fundamentals 1 Chapter 1: The.NET Framework 3 What s the.net Framework? 3 Common Language Runtime 3.NET Framework Class Library 4 Assemblies and the Microsoft Intermediate Language

More information

Very similar to Java C++ C-Based syntax (if, while, ) object base class no pointers, object parameters are references All code in classes

Very similar to Java C++ C-Based syntax (if, while, ) object base class no pointers, object parameters are references All code in classes C# Very similar to Java C++ C-Based syntax (if, while, ) object base class no pointers, object parameters are references All code in classes Before we begin You already know and have programmed with Java

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN

C# 2008 and.net Programming for Electronic Engineers - Elektor - ISBN Contents Contents 5 About the Author 12 Introduction 13 Conventions used in this book 14 1 The Visual Studio C# Environment 15 1.1 Introduction 15 1.2 Obtaining the C# software 15 1.3 The Visual Studio

More information

Discover how to get up and running with the Java Development Environment and with the Eclipse IDE to create Java programs.

Discover how to get up and running with the Java Development Environment and with the Eclipse IDE to create Java programs. Java SE11 Development Java is the most widely-used development language in the world today. It allows programmers to create objects that can interact with other objects to solve a problem. Explore Java

More information

DC69 C# &.NET JUNE C# is a simple, modern, object oriented language derived from C++ and Java.

DC69 C# &.NET JUNE C# is a simple, modern, object oriented language derived from C++ and Java. Q.2 a. What is C#? Discuss its features in brief. 1. C# is a simple, modern, object oriented language derived from C++ and Java. 2. It aims to combine the high productivity of Visual Basic and the raw

More information

Module 4: Data Types and Variables

Module 4: Data Types and Variables Module 4: Data Types and Variables Table of Contents Module Overview 4-1 Lesson 1: Introduction to Data Types 4-2 Lesson 2: Defining and Using Variables 4-10 Lab:Variables and Constants 4-26 Lesson 3:

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

Module 5: Programming with C#

Module 5: Programming with C# Module 5: Programming with C# Contents Overview 1 Lesson: Using Arrays 2 Lesson: Using Collections 21 Lesson: Using Interfaces 35 Lesson: Using Exception Handling 55 Lesson: Using Delegates and Events

More information

Array Structure. In C#, arrays can be declared as fixed length or dynamic. A fixed length array can store a predefined number of items.

Array Structure. In C#, arrays can be declared as fixed length or dynamic. A fixed length array can store a predefined number of items. Array Structure Programming C# is a new self-taught series of articles, in which I demonstrate various topics of C# language in a simple step by step tutorial format. Arrays are probably one of the most

More information

x = 3 * y + 1; // x becomes 3 * y + 1 a = b = 0; // multiple assignment: a and b both get the value 0

x = 3 * y + 1; // x becomes 3 * y + 1 a = b = 0; // multiple assignment: a and b both get the value 0 6 Statements 43 6 Statements The statements of C# do not differ very much from those of other programming languages. In addition to assignments and method calls there are various sorts of selections and

More information

Microsoft. Microsoft Visual C# Step by Step. John Sharp

Microsoft. Microsoft Visual C# Step by Step. John Sharp Microsoft Microsoft Visual C#- 2010 Step by Step John Sharp Table of Contents Acknowledgments Introduction xvii xix Part I Introducing Microsoft Visual C# and Microsoft Visual Studio 2010 1 Welcome to

More information

Arrays and Collections. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies

Arrays and Collections. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies 7 Arrays and Collections C# Programming: From Problem Analysis to Program Design 2nd Edition David McDonald, Ph.D. Director of Emerging Technologies Chapter Objectives Learn array basics Declare arrays

More information

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

Developing Microsoft.NET Applications for Windows (Visual Basic.NET) Developing Microsoft.NET Applications for Windows (Visual Basic.NET) Course Number: 2555 Length: 1 Day(s) Certification Exam This course will help you prepare for the following Microsoft Certified Professional

More information

2609 : Introduction to C# Programming with Microsoft.NET

2609 : Introduction to C# Programming with Microsoft.NET 2609 : Introduction to C# Programming with Microsoft.NET Introduction In this five-day instructor-led course, developers learn the fundamental skills that are required to design and develop object-oriented

More information

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net UNIT 1 Introduction to Microsoft.NET framework and Basics of VB.Net 1 SYLLABUS 1.1 Overview of Microsoft.NET Framework 1.2 The.NET Framework components 1.3 The Common Language Runtime (CLR) Environment

More information

M Introduction to C# Programming with Microsoft.NET - 5 Day Course

M Introduction to C# Programming with Microsoft.NET - 5 Day Course Module 1: Getting Started This module presents the concepts that are central to the Microsoft.NET Framework and platform, and the Microsoft Visual Studio.NET integrated development environment (IDE); describes

More information

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments Basics Objectives Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments 2 Class Keyword class used to define new type specify

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

CHAPTER 1: INTRODUCTION TO THE IDE 3

CHAPTER 1: INTRODUCTION TO THE IDE 3 INTRODUCTION xxvii PART I: IDE CHAPTER 1: INTRODUCTION TO THE IDE 3 Introducing the IDE 3 Different IDE Appearances 4 IDE Configurations 5 Projects and Solutions 6 Starting the IDE 6 Creating a Project

More information

DC69 C# and.net JUN 2015

DC69 C# and.net JUN 2015 Solutions Q.2 a. What are the benefits of.net strategy advanced by Microsoft? (6) Microsoft has advanced the.net strategy in order to provide a number of benefits to developers and users. Some of the major

More information

INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.)

INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) INTRODUCTION TO.NET Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate Language (IL) Just- In-

More information

Problem Solving with C++

Problem Solving with C++ GLOBAL EDITION Problem Solving with C++ NINTH EDITION Walter Savitch Kendrick Mock Ninth Edition PROBLEM SOLVING with C++ Problem Solving with C++, Global Edition Cover Title Copyright Contents Chapter

More information

Learning C# 3.0. Jesse Liberty and Brian MacDonald O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo

Learning C# 3.0. Jesse Liberty and Brian MacDonald O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo Learning C# 3.0 Jesse Liberty and Brian MacDonald O'REILLY Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo Table of Contents Preface xv 1. C# and.net Programming 1 Installing C# Express 2 C# 3.0

More information

Computer Programming: C++

Computer Programming: C++ The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2003 Muath i.alnabris Computer Programming: C++ Experiment #7 Arrays Part II Passing Array to a Function

More information

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1) Andrew Cumming, SoC Bill Buchanan, SoC W.Buchanan (1) Course Outline Day 1: Morning Introduction to Object-Orientation, Introduction to.net, Overview of.net Framework,.NET Components. C#. Day 1: Afternoon

More information

Objects and Iterators

Objects and Iterators Objects and Iterators Can We Have Data Structures With Generic Types? What s in a Bag? All our implementations of collections so far allowed for one data type for the entire collection To accommodate a

More information

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS Contents Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS 1.1. INTRODUCTION TO COMPUTERS... 1 1.2. HISTORY OF C & C++... 3 1.3. DESIGN, DEVELOPMENT AND EXECUTION OF A PROGRAM... 3 1.4 TESTING OF PROGRAMS...

More information

Object-Oriented Programming in C# (VS 2015)

Object-Oriented Programming in C# (VS 2015) Object-Oriented Programming in C# (VS 2015) This thorough and comprehensive 5-day course is a practical introduction to programming in C#, utilizing the services provided by.net. This course emphasizes

More information

First Name: Last: ID# 1. Hexadecimal uses the symbols 1, 2, 3, 4, 5, 6, 7 8, 9, A, B, C, D, E, F,G.

First Name: Last: ID# 1. Hexadecimal uses the symbols 1, 2, 3, 4, 5, 6, 7 8, 9, A, B, C, D, E, F,G. IST 311 - Exam1 - Fall 2015 First Name: Last: ID# PART 1. Multiple-choice / True-False (30 poinst) 1. Hexadecimal uses the symbols 1, 2, 3, 4, 5, 6, 7 8, 9, A, B, C, D, E, F,G. 2. The accessibility modifier

More information

Arrays. CSE 142, Summer 2002 Computer Programming 1.

Arrays. CSE 142, Summer 2002 Computer Programming 1. Arrays CSE 142, Summer 2002 Computer Programming 1 http://www.cs.washington.edu/education/courses/142/02su/ 5-Aug-2002 cse142-16-arrays 2002 University of Washington 1 Reading Readings and References»

More information

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Language Features. 1. The primitive types int, double, and boolean are part of the AP Language Features 1. The primitive types int, double, and boolean are part of the AP short, long, byte, char, and float are not in the subset. In particular, students need not be aware that strings are

More information

The C# Programming Language. Overview

The C# Programming Language. Overview The C# Programming Language Overview Microsoft's.NET Framework presents developers with unprecedented opportunities. From web applications to desktop and mobile platform applications - all can be built

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 24 March 18, 2016 The Java ASM What is the value of ans at the end of this program? Counter[] a = { new Counter(), new Counter() ; Counter[] b = {

More information

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations , 1 C#.Net VT 2009 Course Contents C# 6 hp approx. BizTalk 1,5 hp approx. No exam, but laborations Course contents Architecture Visual Studio Syntax Classes Forms Class Libraries Inheritance Other C# essentials

More information

Exam Questions Demo Microsoft. Exam Questions

Exam Questions Demo   Microsoft. Exam Questions Microsoft Exam Questions 98-361 Microsoft MTA Software Development Fundamentals Version:Demo 1. This question requires that you evaluate the underlined text to determine if it is correct. To minimize the

More information

Index COPYRIGHTED MATERIAL

Index COPYRIGHTED MATERIAL Index COPYRIGHTED MATERIAL Note to the Reader: Throughout this index boldfaced page numbers indicate primary discussions of a topic. Italicized page numbers indicate illustrations. A abstract classes

More information

The Foundation of C++: The C Subset An Overview of C p. 3 The Origins and History of C p. 4 C Is a Middle-Level Language p. 5 C Is a Structured

The Foundation of C++: The C Subset An Overview of C p. 3 The Origins and History of C p. 4 C Is a Middle-Level Language p. 5 C Is a Structured Introduction p. xxix The Foundation of C++: The C Subset An Overview of C p. 3 The Origins and History of C p. 4 C Is a Middle-Level Language p. 5 C Is a Structured Language p. 6 C Is a Programmer's Language

More information

About this exam review

About this exam review Final Exam Review About this exam review I ve prepared an outline of the material covered in class May not be totally complete! Exam may ask about things that were covered in class but not in this review

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming 1. What is object-oriented programming (OOP)? OOP is a technique to develop logical modules, such as classes that contain properties, methods, fields, and events. An object

More information

VB.NET MOCK TEST VB.NET MOCK TEST III

VB.NET MOCK TEST VB.NET MOCK TEST III http://www.tutorialspoint.com VB.NET MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to VB.Net. You can download these sample mock tests at your local

More information

Collections. Collections Collection types Collection wrappers Composite classes revisited Collection classes Hashtables Enumerations

Collections. Collections Collection types Collection wrappers Composite classes revisited Collection classes Hashtables Enumerations References: Beginning Java Objects, Jacquie Barker; The Java Programming Language, Ken Arnold and James Gosling; IT350 Internet lectures 9/16/2003 1 Collections Collection types Collection wrappers Composite

More information

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime

Visual Studio.NET.NET Framework. Web Services Web Forms Windows Forms. Data and XML classes. Framework Base Classes. Common Language Runtime Intro C# Intro C# 1 Microsoft's.NET platform and Framework.NET Enterprise Servers Visual Studio.NET.NET Framework.NET Building Block Services Operating system on servers, desktop, and devices Web Services

More information

Introduction To C#.NET

Introduction To C#.NET Introduction To C#.NET Microsoft.Net was formerly known as Next Generation Windows Services(NGWS).It is a completely new platform for developing the next generation of windows/web applications. However

More information

Java Programming with Eclipse

Java Programming with Eclipse One Introduction to Java 2 Usage of Java 3 Structure of Java 4 Flexibility of Java Programming 5 Using the Eclipse Software 6 Two Running Java in Eclipse 7 Introduction 8 Using Eclipse 9 Workspace Launcher

More information

Lesson 06 Arrays. MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL

Lesson 06 Arrays. MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Lesson 06 Arrays MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Array An array is a group of variables (called elements or components) containing

More information

DOT NET SYLLABUS FOR 6 MONTHS

DOT NET SYLLABUS FOR 6 MONTHS DOT NET SYLLABUS FOR 6 MONTHS INTRODUCTION TO.NET Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate

More information

CHAPTER 1: INTRODUCING C# 3

CHAPTER 1: INTRODUCING C# 3 INTRODUCTION xix PART I: THE OOP LANGUAGE CHAPTER 1: INTRODUCING C# 3 What Is the.net Framework? 4 What s in the.net Framework? 4 Writing Applications Using the.net Framework 5 What Is C#? 8 Applications

More information

.Net Technologies. Components of.net Framework

.Net Technologies. Components of.net Framework .Net Technologies Components of.net Framework There are many articles are available in the web on this topic; I just want to add one more article over the web by explaining Components of.net Framework.

More information

Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book

Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book 1 Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book Year 1 Lecturer's name: MSc. Sami Hussein Ismael Academic

More information

2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a) and (b) D. stands for Graphic Use Interaction

2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a) and (b) D. stands for Graphic Use Interaction 1. Which language is not a true object-oriented programming language? A. VB 6 B. VB.NET C. JAVA D. C++ 2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a)

More information

Arrays. Comp Sci 1570 Introduction to C++ Array basics. arrays. Arrays as parameters to functions. Sorting arrays. Random stuff

Arrays. Comp Sci 1570 Introduction to C++ Array basics. arrays. Arrays as parameters to functions. Sorting arrays. Random stuff and Arrays Comp Sci 1570 Introduction to C++ Outline and 1 2 Multi-dimensional and 3 4 5 Outline and 1 2 Multi-dimensional and 3 4 5 Array declaration and An array is a series of elements of the same type

More information

Burrows & Langford Chapter 10 page 1 Learning Programming Using VISUAL BASIC.NET

Burrows & Langford Chapter 10 page 1 Learning Programming Using VISUAL BASIC.NET Burrows & Langford Chapter 10 page 1 CHAPTER 10 WORKING WITH ARRAYS AND COLLECTIONS Imagine a mail-order company that sells products to customers from all 50 states in the United States. This company is

More information

Learning to Program in Visual Basic 2005 Table of Contents

Learning to Program in Visual Basic 2005 Table of Contents Table of Contents INTRODUCTION...INTRO-1 Prerequisites...INTRO-2 Installing the Practice Files...INTRO-3 Software Requirements...INTRO-3 Installation...INTRO-3 Demonstration Applications...INTRO-3 About

More information

DAD Lab. 1 Introduc7on to C#

DAD Lab. 1 Introduc7on to C# DAD 2017-18 Lab. 1 Introduc7on to C# Summary 1..NET Framework Architecture 2. C# Language Syntax C# vs. Java vs C++ 3. IDE: MS Visual Studio Tools Console and WinForm Applica7ons 1..NET Framework Introduc7on

More information

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University CS5000: Foundations of Programming Mingon Kang, PhD Computer Science, Kennesaw State University Arrays A data structure for a collection of data that is all of the same data type. The data type can be

More information

Advanced Programming Methods. Lecture 9 - Generics, Collections and IO operations in C#

Advanced Programming Methods. Lecture 9 - Generics, Collections and IO operations in C# Advanced Programming Methods Lecture 9 - Generics, Collections and IO operations in C# Content Language C#: 1. Generics 2. Collections 3. IO operations C# GENERICS C# s genericity mechanism, available

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

High Institute of Computer Science & Information Technology Term : 1 st. El-Shorouk Academy Acad. Year : 2013 / Year : 2 nd

High Institute of Computer Science & Information Technology Term : 1 st. El-Shorouk Academy Acad. Year : 2013 / Year : 2 nd El-Shorouk Academy Acad. Year : 2013 / 2014 High Institute of Computer Science & Information Technology Term : 1 st Year : 2 nd Computer Science Department Object Oriented Programming Section (1) Arrays

More information

Object-Oriented Programming in C# (VS 2012)

Object-Oriented Programming in C# (VS 2012) Object-Oriented Programming in C# (VS 2012) This thorough and comprehensive course is a practical introduction to programming in C#, utilizing the services provided by.net. This course emphasizes the C#

More information

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content Core Java - SCJP Course content NOTE: For exam objectives refer to the SCJP 1.6 objectives. 1. Declarations and Access Control Java Refresher Identifiers & JavaBeans Legal Identifiers. Sun's Java Code

More information

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals:

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: Numeric Types There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: 1-123 +456 2. Long integers, of unlimited

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

EXAMINATIONS 2011 Trimester 2, MID-TERM TEST. COMP103 Introduction to Data Structures and Algorithms SOLUTIONS

EXAMINATIONS 2011 Trimester 2, MID-TERM TEST. COMP103 Introduction to Data Structures and Algorithms SOLUTIONS T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Student ID:....................... EXAMINATIONS 2011 Trimester 2, MID-TERM TEST COMP103 Introduction

More information

XII- COMPUTER SCIENCE VOL-II MODEL TEST I

XII- COMPUTER SCIENCE VOL-II MODEL TEST I MODEL TEST I 1. What is the significance of an object? 2. What are Keyword in c++? List a few Keyword in c++?. 3. What is a Pointer? (or) What is a Pointer Variable? 4. What is an assignment operator?

More information

CPSC 481 Tutorial 4. Intro to Visual Studio and C#

CPSC 481 Tutorial 4. Intro to Visual Studio and C# CPSC 481 Tutorial 4 Intro to Visual Studio and C# Brennan Jones bdgjones@ucalgary.ca (based on previous tutorials by Alice Thudt, Fateme Rajabiyazdi, and David Ledo) Announcements I emailed you an example

More information

Standard. Number of Correlations

Standard. Number of Correlations Computer Science 2016 This assessment contains 80 items, but only 80 are used at one time. Programming and Software Development Number of Correlations Standard Type Standard 2 Duty 1) CONTENT STANDARD

More information

Steps of initialisation:

Steps of initialisation: 1. a. Arrays in C# are objects and derive from System.Array. They are the simplest collection or data structure in C# and may contain any value or reference type. In fact, an array is the only collection

More information

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. CMSC 131: Chapter 28 Final Review: What you learned this semester The Big Picture Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. Java

More information

Indexers.

Indexers. Indexers Indexers are special type of class members that provide the mechanism by which an object can be indexed like an array. Main use of indexers is to support the creation of specialized array that

More information

Object oriented programming C++

Object oriented programming C++ http://uranchimeg.com Object oriented programming C++ T.Uranchimeg Prof. Dr. Email uranchimeg@must.edu.mn Power Engineering School M.EC203* -- OOP (C++) -- Lecture 06 Subjects Functions Functions with

More information

Java 1.8 Programming

Java 1.8 Programming One Introduction to Java 2 Usage of Java 3 Structure of Java 4 Flexibility of Java Programming 5 Two Running Java in Dos 6 Using the DOS Window 7 DOS Operating System Commands 8 Compiling and Executing

More information

C# Programming in the.net Framework

C# Programming in the.net Framework 50150B - Version: 2.1 04 May 2018 C# Programming in the.net Framework C# Programming in the.net Framework 50150B - Version: 2.1 6 days Course Description: This six-day instructor-led course provides students

More information

5/23/2015. Core Java Syllabus. VikRam ShaRma

5/23/2015. Core Java Syllabus. VikRam ShaRma 5/23/2015 Core Java Syllabus VikRam ShaRma Basic Concepts of Core Java 1 Introduction to Java 1.1 Need of java i.e. History 1.2 What is java? 1.3 Java Buzzwords 1.4 JDK JRE JVM JIT - Java Compiler 1.5

More information

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class.

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class. 1. What is C#? C# (pronounced "C sharp") is a simple, modern, object oriented, and type safe programming language. It will immediately be familiar to C and C++ programmers. C# combines the high productivity

More information

Part I: Short Answer (12 questions, 65 points total)

Part I: Short Answer (12 questions, 65 points total) CSE 143 Sp01 Final Exam Sample Solution page 1 of 14 Part I: Short Answer (12 questions, 65 points total) Answer all of the following questions. READ EACH QUESTION CAREFULLY. Answer each question in the

More information

COSC 123 Computer Creativity. Java Lists and Arrays. Dr. Ramon Lawrence University of British Columbia Okanagan

COSC 123 Computer Creativity. Java Lists and Arrays. Dr. Ramon Lawrence University of British Columbia Okanagan COSC 123 Computer Creativity Java Lists and Arrays Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Objectives 1) Create and use arrays of base types and objects. 2) Create

More information

Arrays and functions in C#

Arrays and functions in C# Object-Oriented Programming Chapter 3 Arrays and functions in C# 39 Chapter 3 Arrays and functions in C# Chapter 3 Arrays and functions in C# By the end of this chapter, you should see that the difference

More information

CPSC Tutorial 4

CPSC Tutorial 4 CPSC 481 - Tutorial 4 Visual Studio and C# (based on previous tutorials by Alice Thudt, Fateme Rajabiyazdi, David Ledo, Brennan Jones, Sowmya Somanath, and Kevin Ta) Introduction Contact Info li26@ucalgary.ca

More information