Click here to Skip to main content
15,921,250 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
There are 2 animal species: zoro and toro. These animals are mortal enemies and often battle to the death whenever they meet. zoros are notorious for their sharp, piercing teeth, and are known to prey on toro from the front to gain an advantage in battle. toto are well known for their deadly spiked tails, and will often prefer to attack zoro’s from the rear to gain an advantage. Write a program that models 2 creatures (1 zoro and 1 toro) and shows results of their fight. Be sure to showcase the 4 principles of object oriented programming in your code.

What I have tried:

C#
public class zoro
{
    public teeth {get;set;}
}
public class teeth
{
     public string sharp {get;set;}
     public string piercing {get;set;}
}
Posted
Updated 17-Feb-17 17:08pm
v2
Comments
[no name] 17-Feb-17 16:17pm    
And the specific question regarding your code that your teacher couldn't answer for you would be what?
Code108 17-Feb-17 16:35pm    
Looks like you do not know either.
[no name] 17-Feb-17 17:18pm    
And you know that how? It's not my homework assignment, no one here is going to do it for you and it's not our job to teach you programming. You've been here way long enough to have read the FAQ and know how this works.
Rick York 17-Feb-17 17:19pm    
I think you missed his point which is this forum is for people to ask specific questions and with luck you will receive a specific answer.

To "ask" the general question, "how do I approach this with C#?" is not why this forum is here. That is what your teacher and TA(s) are for.

He probably has a very good idea on how to approach it but since that is not the purpose of this forum why should he or anyone else waste their time describing it? I am not going waste my time even considering an approach.
Code108 17-Feb-17 17:29pm    
Can you atleast give me pointers? Thanks.

We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.

As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.
 
Share this answer
 
Just to give you a head start,
1. What do zoro and toro have in common? Reading from the homework statement, it seems that they both have their preferred preys, can fight in a certain way with their deadly weapon of sort, anymore? Can you create a generic blueprint that represents any creature that possesses such features (properties) and behaviors (methods) without specific details. That shall be the class in OOP.
2. Create a specific class for zoro that inherits from the creature blueprint but with specific features and behaviors pertaining to zoro kind.
3. Do the same for toro.
4. You will have to run the remaining journey yourself. Read out on Introduction to Object Oriented Programming Concepts (OOP) and More[^]
Try harder, not to be afraid to make some wrong turns, and you shall succeed!
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900