0% found this document useful (0 votes)
102 views21 pages

C# Classes and Encapsulation Overview

This document summarizes a lecture on C# classes and objects. It discusses creating an Account class with properties for name and balance, as well as using set and get methods. It also covers initializing objects with constructors and having students run example code from Google Drive for homework.

Uploaded by

ishtiaq mushtaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views21 pages

C# Classes and Encapsulation Overview

This document summarizes a lecture on C# classes and objects. It discusses creating an Account class with properties for name and balance, as well as using set and get methods. It also covers initializing objects with constructors and having students run example code from Google Drive for homework.

Uploaded by

ishtiaq mushtaq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Emerging Technologies (IT-3302)

Week # 05

Usman Akbar
[Link]@[Link]
FB Group - SuperiorUniversity2016
Lecture Review

Last lecture review


 C # Classes / Objects / Methods
 C# - Encapsulation
 Public
 Private
 Protected

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 2


Account: (Class with an Instance Variable) Set/Get Methods

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 4


Data members / Methods

SetName Parameter List

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 5


Account Class with a Property Rather Than Set and Get Methods

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 6


Software Engineering with Set and Get Methods

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 7


Class (AccountTest) Using Account’s Name Property

Before

Setting
After

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 8


Invoking Class Account’s Name Property to Set the Name

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 9


Output

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 10


Question

Questions….?
Class Task

Write Console C# Program, which implement set/get


concept on Student class for Exam class to print result of
semester.

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 12


Break Time

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 13


Account Class: Initializing Objects with Constructors

Same

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 14


EMERGING TECHNOLOGIES ( USMAN AKBAR ) 15
Class AccountTest: Initializing Account Objects

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 16


Account Class with a Balance
&
Processing Monetary Amount

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 17


Account Class

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 18


Main Program AccountTest

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 19


Question

Questions….?
Home Work

Run all class practive codes provides in Google Drive

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 21


References

C# 6 for Programmers ( Chapter # 4 )

Social Community Help ….!


 [Link]
 [Link]
 [Link]
 [Link]
 [Link]

EMERGING TECHNOLOGIES ( USMAN AKBAR ) 22

You might also like