Question: Write a program that asks the user to type an animal name, as seen below. The program must then show the sound the animal makes.

Write a program that asks the user to type an animal name, as seen below. The program must then show the sound the animal makes. The program must then ask for another animal name, and keep running until the user enters "quit". If the animal name is not recognised, the program must display "Unrecognised animal".
The following animals and sounds must be implemented:
Animal Sound
cat meow
cow moo
dog woof
sheep baa
Your output should be presented as follows (user input appears in bold in order to help you determine the input from output you are not required to make the text bold):
Please type an animal: cat
meow
Please type an animal: banana
Unrecognised animal
Please type an animal: cow
moo
Please type an animal: quit
You will need to write a complete program to do this.
Please note: the quiz system will not accept gets. You should use scanf to read the input from the user.
(I WAS PROVIDED AN ANSWER BUT DOES NOT WORK. THE PROGRAM SHOULD ALLOW US TO TELL WHAT THE ANIMALS IS IF WRONG IT SHOULD SAY UNRECOGNISED ANIMAL.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!