What's new

inheritance c#

pompyim

Eternal Poster
Established
Joined
Aug 20, 2016
Posts
837
Reaction
226
Points
295
Age
25
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
 

Similar threads

Back
Top