• Save
Cis166 final review
Upcoming SlideShare
Loading in...5
×
 
  • 466 views

 

Statistics

Views

Total Views
466
Views on SlideShare
382
Embed Views
84

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 84

http://rriness.spscc.edu 81
http://www.slideshare.net 3

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Cis166 final review Cis166 final review Presentation Transcript

    • CIS-166 Final
      • Open book, open notes, open computer
      • 100 points
      • True/false, multiple choice, fill-in, short answer
      • Emphasis on material since midterm
    • Object Terminology Review
      • Object - like a noun, a thing
        • An object is based on a class
      • Properties - like an adjective, characteristics of object
      • Methods - like a verb, an action or behavior, something the object can do
      • Events - object response to user action or other events
    • Polymorphism
      • Overloading: Argument type determines which version of a method is used
        • Example: MessageBox.Show method
      • Overriding: Refers to a class that has the same method name as its base class
        • Method in subclass takes precedence
    • Specifying a Namespace
      • Namespaces are used in .Net to organize classes and source files
      • When referring to classes in a different namespace
        • Write out the entire namespace
        • Add an Imports Statement to include the namespace
      Public Class Form1 Inherits System.Windows.Forms.Form Name of the Class Namespace
    • Instance versus Shared Variables
      • Instance variables or properties use a separate memory location for each instance of the object
      • Shared variables or properties use a single memory location that is available for ALL objects of a class
        • Can be accessed without instantiating an object of the class
        • Use the Shared keyword to create
      Shared Methods can also be created
    • Constructors and Destructors
      • Constructor: Method that automatically executes when an object is instantiated
        • Create by writing a Public Sub New procedure
      • Destructor: Method that automatically executes when an object is destroyed
        • Create by writing a Finalize procedure
    • Collections
      • Group of objects
        • Can be strongly typed: all objects based on the same class
      • Similar to an array
        • Collection expands and contracts automatically
      • Have common properties and methods
        • Add, Remove, Count, Item
    • Item Property
      • Typically set as default property for a collection
      • Returns a member of the group
        • Typically based on an Index
        • Data type depends on the type of objects the collection manages
    • Text Data Files
      • Actual data stored in files on disk device
      • File ==> Entire collection of data of data
      • Records ==> Rows or lines, one per entity
      • Fields ==> Data elements within row
    • Text File Handling
      • A Stream is designed to transfer a series of bytes from one location to another
      • Streams are objects that have properties and methods
      • Found in the System.IO namespace
      • File handling projects usually contain an Imports statement before the statement declaring the form's class
    • Writing Data Files
      • Declare a new StreamWriter object
      • Use StreamWriter's WriteLine method
      • Call StreamWriter's Close method
    • Write and WriteLine Methods
      • Write Method: Places items consecutively in the file with no separator
      • WriteLine Method: Places an Enter (carriage return) between records
    • Reading Files
      • Declare a new StreamReader object
        • File must exist!
      • Use StreamReader's ReadLine method
        • Loop to retrieve multiple records
      • Call StreamReader's Close method
    • ReadLine Method
      • Use to read previously saved data
      • Each time it executes, it reads the next line of data
      • Always assign the value from the read to a location, such as a label, text box, or string variable
    • Checking for End of File
      • Use StreamReader's Peek Method
      • Peek looks at the next element without actually reading it
      • If you Peek beyond the last element the value returned is -1