Professional Documents
Culture Documents
Introduction
To OOP 500
Assignment
Question One:
1.1
- Encapsulation: Encapsulation can be used to hide data members and member’s functions.
Encapsulation is one of the fundamental (OOP).Under this definition, encapsulation means
that the internal representation of an object is generally hidden from view outside of the
objects definition. Typically, only the objects own methods can directly inspect or
manipulate its fields.
1.2
Steps:
Step 1: start
Step 2: initialize the know variables: max hours worked with no overtime(MaxNoOvertime),
bonus rate for overtime hours (BounsRate), non taxable payroll amount (MaxNoDue), tax
rate (Due).
Step 3: Enter : hours worked overtime (HoursWorked) and Hourly rate (HourRate).
GrossPay=HoursWorked*HourRate;
Else
GrossPay = HourRate*(MaxNoOvertime + BounsRate*(HoursWorked –
MaxNoOvertime));
NetPay=GrossPay;
Else
NetPay=GrossPay-Due*(GrossPay-MaxNoDue);
Step 7: End.
// Step 1: START
Step 7: netpay
1.3
Question Two:
2.1
Class House
Address=newaddress
Return
If newprice>0 then
Price=newprice
Endif
2.2
Public House(){
Setsize(12)
Settoppings(