0% found this document useful (0 votes)
16 views2 pages

Gui Note 01

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

Gui Note 01

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

combo box

combo box allow users to select users set of values from a drop down list.
to set the values for a combo box we can use items property available for the combo
box.
to access selected item we can use "SelectedItem" property.

populating a combo box dinamically

group box

group box is used to group a set of ui icons for a single use together.
mostly useing senarios where radio buttons are used.

radio button

a radio button is allow user to select only one option from a pre defined set of
values.

check box

check box allow user to select optios from a predefined set of values.
users can select multiple options from available set of values.

encapsulation

encapsulations is one of the core concepts of oop and it can be defined as the
process of wraping attributes and methods manipulating those attributes together as
a single unit.
this is acheved by restricting direct access to attribute variables and providing
accessability through public methods.
encapsulation helps to improve the security of the program by hiding internal
implementation details by restricting direct access.

steps to apply encapsulation

01.declairing all member attributes as private or protected(inheritance)


02. creating public getters and setters as requared for member attributes. these
methods are use to hide actual implimentation of attributes using encription
decription validation and type convertion.
03. creating atleast one costructor to initialize member attribute

write an application to represent a student with attributes name, final marks and
grade as attributes to represent following behaviors
01. apply encapsulation for member attributes
02. a method to accept assigment and exam amrks as parameters to calculate final
marks
final marks = exam marks*0.5 + assigmant marks*0.5
03. a mthod to determine final grade of the student
if final marks>= 60, grade = 'D'
else if final marks>= 40, grade = 'P'
else grade = 'F'

write a console application to represent item with attributes name unit price stock
include the following program
apply encapsulation for attributes
include a method to represent sales opperations by accepting quantity as a
parameter
include a method to represent re stock by accepting new quantity as a parameter
return sales amount when the sales opperations
in the main mathod create an item and set values for item name unit price and stock
perfome sales opperation and re stock opparation as required acording to your
preferences
display stock value of the item using a formula stock value = unit price*stock

You might also like