Review the code below. It should display the following when executing:
Question Get Answer

Review the code below. It should display the following when executing:

Hello

The number of the month is ", 4

Goodbye

Show what will happen when it executes. Then Copy and paste the corrected code in between the ********* below. Create more blank lines between the ***** if needed.

Module main()     

   displayHello()     

   num monthNum = 0     

   monthNum = monthOfYear("April")     

   monthNum = monthNum + 1     

   output "The number of the month is ", monthNum     

   displayClosing()     

End Module     

     

Function displayHello()     

   display "Hello"     

   display " "     

End Function    

     

Function displayGoodbye()     

   display " "    

   display "Goodbye"     

End Function    

          

Function Integer monthOfYear(string month)     

   Declare Integer monthNumber         

   if (month == "January")     

       monthNumber = 0     

   else if (month == "February")     

       monthNumber = 1     

   else if (month == "March")     

       monthNumber = 2     

   else if (month == "April")     

       monthNumber = 3     

   else if (month == "May")     

       monthNumber = 4     

   else if (month == "June")     

       monthNumber = 5     

   else if (month == "July")     

       monthNumber = 6     

   else if (month == "August")     

       monthNumber = 7     

   else if (month == "September")     

       monthNumber = 8     

   else if (month == "October")     

       monthNumber =9     

   else if (month == "November")     

       monthNumber = 10     

   else

       monthNumber = 11     

   end if          

   return monthNumber 

End Function


*************************************************************************************


**************************************************************************************

Review the code below. It should display the following when executing:

Hello

The number of the month is ", 4

Goodbye

Show what will happen when it executes. Then Copy and paste the corrected code in between the ********* below. Create more blank lines between the ***** if needed.

Module main()     

       

   num monthNum = 0     

   monthNum = monthOfYear("April")     

   monthNum = monthNum + 1     

   output "The number of the month is ", monthNum     

   displayGoodbye()     

End Module     

     

Function displayHello()     

   display "Hello"     

   display " "     

End Function    

     

Function displayGoodbye()     

   display " "    

   display "Goodbye"     

End Function    

          

Function Integer monthOfYear(string month)     

   Declare Integer monthNumber         

   if (month == "January")     

       monthNumber = 0     

   else if (month == "February")     

       monthNumber = 1     

   else if (month == "March")     

       monthNumber = 2     

   else if (month == "April")     

       monthNumber = 3     

   else if (month == "May")     

       monthNumber = 4     

   else if (month == "June")     

       monthNumber = 5     

   else if (month == "July")     

       monthNumber = 6     

   else if (month == "August")     

       monthNumber = 7     

   else if (month == "September")     

       monthNumber = 8     

   else if (month == "October")     

       monthNumber =9     

   else if (month == "November")     

       monthNumber = 10     

   else

       monthNumber = 11     

   end if          

   return monthNumber 

End Function


*************************************************************************************


**************************************************************************************

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 Computer Science tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes