Explore Westonci.ca, the leading Q&A site where experts provide accurate and helpful answers to all your questions. Get quick and reliable solutions to your questions from knowledgeable professionals on our comprehensive Q&A platform. Get quick and reliable solutions to your questions from a community of experienced experts on our platform.

In your Code Editor, there is some code meant to output verses of the song "Old MacDonald had a farm. "


When the code is working properly, if the user types in pig for an animal (when prompted to "Enter an animal: ") and oink for the sound


(when prompted to "Enter a sound: "), the program should output the following as it runs:


Old Macdonald had a farm, E-I-E-I-0


And on his farm he had a pig, E-I-E-I-O


with a oink-oink here and a oink-oink there


Here a oink there a oink


Everywhere a oink-oink


old Macdonald had a farm, E-I-E-I-0


There are a few errors in the code provided in the Code Editor. Your task is to debug the code so that it outputs the verses correctly.


Hints:


Try running the code and looking closely at what is output. The output can be a clue as to where you will need to make changes in


the code you are trying to debug.
. Check the variable assignments carefully to make sure that each variable is called correctly.


Look at the spacing at the end of strings - does each string have the appropriate number of spaces after it?


Sagot :

Thank you for visiting our platform. We hope you found the answers you were looking for. Come back anytime you need more information. Your visit means a lot to us. Don't hesitate to return for more reliable answers to any questions you may have. Thank you for visiting Westonci.ca. Stay informed by coming back for more detailed answers.