Wineitot
New member
- Joined
- Jan 26, 2023
- Messages
- 2
- Programming Experience
- Beginner
Hi,
I have in
And in the Pet class I have:
Then I have:
And last
What I need is another step. I want the isFemale in string textOutTwo to put out girl if response is y/Y and boy if something else. So I need to convert true to girl and false to boy in some way. Now I only get true or false as the output. But I want girl or boy. Anyone that have an idea how to do this?
I have in
C#:
static void Main(string[] args) petObj.start();
And in the Pet class I have:
C#:
class Pet
public void Start()
{
ReadAndSavePetData();
DisplayPetInfo();
}
C#:
public void ReadAndSavePetData ()
{
char response = strGender[0];
if ((response == 'y') || (response == 'Y')
isFemale = true;
else
isFemale = false;
}
C#:
public void DisplayPetInfo()
{
string textOutTwo = isFemale;
}
Last edited by a moderator: