🔒 Closed inheritance c#

Status
Not open for further replies.

pompyim

Honorary Poster
pahelp naman po baka po alam nyo kung paano code at explanation neto

Define a class Human with properties "first name" and "last name". Define
the class Student inheriting Human, which has the property "mark". Define
the class Worker inheriting Human with the property "wage" and "hours
worked". Implement a "calculate hourly wage" method, which calculates a
worker’s hourly pay rate based on wage and hours worked. Write the
corresponding constructors and encapsulate all data in properties.

TIA :)
 
What homer said ^.

Let me help you further:
1. Define a class Human with properties "first name" and "last name"
- How do you create a class? If you don't know, GOOGLE IT
- Create the class and namedit Human
- Add two props

2. Define the class Student inheriting Human, which has the property "mark"
- Same as #1

3. Define the class Worker inheriting Human with the property "wage" and "hours
worked".
- Same as #1

4. Implement a "calculate hourly wage" method, which calculates a
worker’s hourly pay rate based on wage and hours worked.
- How do you create a method or function? Again GOOGLE is your friend
- How do you access values from classes? Ask GOOGLE
- Write the implementation. If you can't do this, GOOGLE again

5. Write the corresponding constructors and encapsulate all data in properties.
- If you managed to do #1-#4, then you should know the drill on how to solve this one
 
What homer said ^.

Let me help you further:
1. Define a class Human with properties "first name" and "last name"
- How do you create a class? If you don't know, GOOGLE IT
- Create the class and namedit Human
- Add two props

2. Define the class Student inheriting Human, which has the property "mark"
- Same as #1

3. Define the class Worker inheriting Human with the property "wage" and "hours
worked".
- Same as #1

4. Implement a "calculate hourly wage" method, which calculates a
worker’s hourly pay rate based on wage and hours worked.
- How do you create a method or function? Again GOOGLE is your friend
- How do you access values from classes? Ask GOOGLE
- Write the implementation. If you can't do this, GOOGLE again

5. Write the corresponding constructors and encapsulate all data in properties.
- If you managed to do #1-#4, then you should know the drill on how to solve this one
maraming salamat po, malaking tulong po ito
 
Status
Not open for further replies.

About this Thread

  • 7
    Replies
  • 2K
    Views
  • 5
    Participants
Last reply from:
Aoshinomori

Trending Topics

Online now

Members online
333
Guests online
957
Total visitors
1,290

Forum statistics

Threads
2,281,359
Posts
29,003,030
Members
1,225,283
Latest member
intelcore
Back
Top