OBJECT ORIENTED PROGRAMMING, LABORATORY
EXERCISE NO. 4
OBJECTIVE:
Be able to apply concepts on properties, behavior and nested if.
PROBLEM:
Create an application that will identity the academic standing of a student. The
application should request a user to enter his/her average and lowest grade. After
which, your application should evaluate the input entered by the user and display a
corresponding result using the given conditions below.
Average Lowest Remarks
‘92 and above 85 and above Full Academic Scholar
90 - 91.99 85 and above Half Academic Scholar]
‘88 and above 80 and above Dean’s Lister
none of the above Sorry, not qualified
DIRECTIONS:
Create a new project (Windows Application). Save the project as pe#_act4,
example: pe12_act4.
1
Change the title of the form as Academic Standing. Set the
FormBorderStyle property to FixedSingle to disallow users from resizing
the window
Design your form based on the given interface below. Note that the object
that surrounds the two buttons below is a Panel control that is available in
your Toolbox under the Containers category.
lick Panel in the toolbox and drag it covering the 2 buttons. Right click the
panel and select Sent to Back. Change the BorderStyle property to
Fixed3D.
Set the Name property of each textbox to txtAverageGrade,
txtLowestGrade and txtResult respectively. Set also the Enabled property
of txtResult to False to disallow users from typing any data in this textbox.
MR. EDMUND D. EVANGELISTA, University of
int Louis Page 1OBJECT ORIENTED PROGRAMMING, LABORATORY
5. Set the Name property of each button to btnEvaluate and btncancel
respectively.
6. Double click the Evaluate button and insert the given codes below:
double avg, lowest;
String remarks;
if((txtAverageGrade.Text JIL (txtLowest.Text
t
//Displays a message box with complete parameters
MessageBox,Show("Please complete the information",
“warning!", MessageBoxButtons.OK,
MessageBoxIcon.Error);
avg = Double.Parse(txtAverageGrade.Text);
lowest = Double.Parse(txtLowest.Text);
if ((avg >= 92) && (lowest >= 85))
remark ull Academic Scholar";
else if ((avg >= 90) && (lowest >= 85))
remarks = "Half Academic Scholar";
else if (avg
remarks
else
remarks = "Sorry, not qualified!";
txtResult.Text = remarks;
+
7. Double click the Cancel button and insert the given codes below:
txtAverageGrade.Clear();
txtLowest.Clear();
txtResult.Clear();
8. Run your application
SAMPLE DIALOGUE:
Bocieninay ae Tinian aa
Aveage ade ST Average ode: 94
Loweetgade: &T Loves gece:
MR. EDMUND D. EVANGELISTA, University of Saint Louis Page 2OBJECT ORIENTED PROGRAMMING, LABORATORY
EXERCISE NO. 5
OBJECTIVE:
Be able to apply concepts on Properties, Behavior and Nested If.
PROBLEM:
Develop an application that will compute the tax of any individual payee and display
the net Income as a result. The computation of the tax Is based on the following:
Civil Status Code | Tax (with dependents) | Tax (w/out dependents)
1- Single 10% of Gross Income | 15% of Gross Income
2= Married 5% of Gross Income ‘9% of Gross Income
3 = Widow/Widower | 7% of Gross Income 11% of Gross Income
4= Separated 8% of Gross Income 12% of Gross Income
Net income is computed as:
Net income = Gross income - Total Deductions
Total deductions = total of the following:
+ Tax (refer to the given table above)
+ Pagibig/Medicare = P320
+ SSS = 5% of Gross income
The input shell be the following: civil status code, dependents code (0 - without
dependents / 1 - with dependents), and gross income,
DIRECTIONS:
1. Create a new project (Windows Application). Save the project as pe#_actS,
example: pe12_act5.
2. Design the given interface below. Be free but descriptive in assigning the
name property of each of your controls.
3. Write your own code to fulfill the requirements and desired output of the
problem,
Tac Payment Form
Dependerts
Gross here sss
INET INCOME: DEDUCTIONS:
(Ceowoste |} (cour) (ba)
MR. EDMUND D. EVANGELISTA, University of
Page 1OBJECT ORIENTED PROGRAMMING, LABORATORY EXERCISES:
SAMPLE DIALOGUE:
See
Cha Sttu: 7
Dependents: (0 PagibighMed:
Gross Inccme: (15000 555:
NET INCOME: DEDUCTIONS:
(exes) con_J
Sed
Cha Staus (7
Dependents: (0
Goss Inceme: 15000
NET INCOME: [P1680 DEDUCTIONS P20
[compute] (_cew_] (et)
MR. EDMUND D. EVANGELISTA, University of S
Page 2