Ask Question
9 April, 06:48

Days of Each Month Design a program that displays the number of days in each month. The program’s output should be similar to this: January has 31 days. February has 28 days. March has 31 days. April has 30 days. May has 31 days. June has 30 days. July has 31 days. August has 31 days. September has 30 days. October has 31 days. November has 30 days. December has 31 days. Psuedocode

+3
Answers (1)
  1. 9 April, 07:04
    0
    A python script:

    months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]

    numbers = [31,28,31,30,31,30,31,31,30,31,30,31]

    counter = 0

    numbers_length=len (numbers) - 1

    while counter < = numbers_length:

    month=months[counter]

    number=numbers[counter]

    print (month + " has " + str (number) + " days")

    counter = counter+1

    Explanation:

    The Python script above will generate this output:

    January has 31 days.

    February has 28 days.

    March has 31 days.

    April has 30 days.

    May has 31 days.

    June has 30 days.

    July has 31 days.

    August has 31 days.

    September has 30 days.

    October has 31 days.

    November has 30 days.

    December has 31 days.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Days of Each Month Design a program that displays the number of days in each month. The program’s output should be similar to this: ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers