In Python
The following code is intentionally done in poor style but runsas intended.
def main():
c = 10
print(\"Welcome to Roderick's Chikkin and Gravy\")
e = False
while not e:
x = input(\"Would you like some chikkin?\")
if x == \"Y\" or x == \"y\":
c = f(c)
else:
e = True
if c == 0:
e = True
print(\"I hope you enjoyed your chikkin!\")
def f(c):
if c > 0:
print(\"Got you some chikkin! Enjoy\")
return c-1
else:
print(\"No chikkin left. Sorry\")
return 0
main()
1.Fix it *then* add the functions mentioned (Including totallydeleting these comments at the top and replacing them with)
What should be here as well as changing the repl name!?
2.Fix the style of this program so it is clear what it isdoing.
3.Add to the code so that, if you want chikkin, you are asked ifyou want gravy. If you say yes, the (only) output for that ordershould be, \"You get some chikkin and gravy then!\" If not, it shouldgive the same output as the original program. In both cases, itwill then ask you again if you want any chikkin.
4.Add to the code so that, if you want chikkin, you are asked ifyou want gravy. If you say yes, the (only) output for that ordershould be, \"You get some chikkin and gravy then!\" If not, it shouldgive the same output as the original program. In both cases, itwill then ask you again if you want any chikkin. (You can dowhatever you would like to get this to happen - adding a newfunction is not required but don't delete the old functionentirely). Assume you have infinite gravy so no tracking how muchgravy there is.
5.Write a simple function named startingChikkin() that has noparameters and just asks the user for how much chikkin we startwith. If the user types a positive integer, then return that value.If not, prompt again repeatedly until they enter a positive integerwhich you then return (see earlier sections on input validation) -the loop should be inside of your function. Call startingChikkin()at the start of the main() program and store the value returnedinto whatever you called your variable for tracking the number ofchikkins left.