Ask your own question, for FREE!
Astronomy 23 Online
jayfafr:

help me with this code Pickle

jayfafr:

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-O 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-O 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.

TheKaylaHope:

@Dude @Vocaloid @ultrilliam @shadow

California:

@jayfafr wrote:
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-O 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-O 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.
Where is the coding

California:

What language is it in?

jayfafr:

@california wrote:
What language is it in?
idk what it is in but this is what i have animal = input("Enter an animal: ") sound = input("Enter a sound: ") e = "E" print("Old Macdonald had a farm," + e) print("And on his farm he had a" + sound + "," + e) print("With a " + animal + " - " + animal + " here and a" + sound + "-" + sound + " there") print("Here a "+ sound + "there a" +sound) print("Everywhere a" + animal + "- " + sound) print("Old Macdonald had a farm ," + e)

California:

Send a screenshot

jayfafr:

here

jayfafr:

jayfafr:

jayfafr:

jayfafr:

jayfafr:

but i think the code languange is java

California:

One sec

California:

I need to input this into my comp

jayfafr:

@california wrote:
I need to input this into my comp
alr

California:

alr i got it.

California:

So, what the words they give you are (pig) and (oink). they practically already have the code written out for you though. It should be animal=input("text") sound=input("text) e="e" print("text"+e) print("text"+sound+"text"+e) and so on

California:

however. I did happen to show you how to do it. I didn't directly give you the answer because, I explained it to you so you may understand it better.

California:

jayfafr:

@california wrote:
thanks

California:

@jayfafr wrote:
@california wrote:
thanks
You're welcome

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!