Your SlideShare is downloading. ×
Cis166 final review
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
301
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CIS-166 Final
    • Open book, open notes, open computer
    • 100 points
    • True/false, multiple choice, fill-in, short answer
    • Emphasis on material since midterm
  • 2. 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
  • 3. 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
  • 4. 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
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. 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
  • 10. 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
  • 11. Writing Data Files
    • Declare a new StreamWriter object
    • Use StreamWriter's WriteLine method
    • Call StreamWriter's Close method
  • 12. Write and WriteLine Methods
    • Write Method: Places items consecutively in the file with no separator
    • WriteLine Method: Places an Enter (carriage return) between records
  • 13. 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
  • 14. 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
  • 15. 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