I need it to return a date with a form of MM/DD/YYYY but the month snees to say the name of the Month not the number. My Proffesor stated I need to have a Main function, processing and display function, at least one value returning and Correct use of string functions.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I'm having some Issues with this code. I need it to return a date with a form of MM/DD/YYYY but the month snees to say the name of the Month not the number. My Proffesor stated I need to have a Main function, processing and display function, at least one value returning and Correct use of string functions. 

The image displays a Python script designed to convert a date from the format "MM/DD/YYYY" to a long date format such as "Month Day, Year." Below is the transcription and explanation of the code:

```python
def main():
    MonthNum=0;MonthName='';DateString='';Day=0;Year=0;LongDate=''
    LongDate=processing(MonthNum,MonthName,Day,Year)
    Display(LongDate)

def processing(MonthNum,MonthName,Day,Year):
    MonthList=['January','February','March','April','May','June','July','August','September','October','November','December']
    DateString=input('Enter a date in the format MM/DD/YYYY: ')
    DateList=DateString.split('/')
    MonthNum = int(DateList[0])
    Day= DateList[1]
    Year=DateList[2]
    MonthName=MonthList[MonthNum -1]
    LongDate= MonthName + ' ' +Day+ ', '+Year
    return LongDate

def Display(LongDate):
    print(LongDate)

main()
```

### Code Explanation

- **Function Definitions:**
  - `main()`: This is the main function that initializes variables and calls `processing()` and `Display()`.
  - `processing()`: This function takes month, day, and year as inputs and converts the date from "MM/DD/YYYY" format to a long date string by extracting the month name from a list of month names.
  - `Display()`: This function prints out the long date format.

- **Variables:**
  - `MonthNum`: Stores the numeric value of the month.
  - `MonthName`: Holds the name of the month (e.g., January).
  - `DateString`: A string where the user inputs the date.
  - `Day`, `Year`: Variables to store day and year extracted from `DateString`.
  - `LongDate`: A formatted string combining `MonthName`, `Day`, and `Year`.

- **Logic:**
  - `MonthList`: A list containing all month names.
  - `DateString=input(...)`: Prompts the user to enter a date.
  - `DateList=DateString.split('/')`: Splits the date string into a list using the '/' as a delimiter.
  - `MonthNum = int(DateList[0])`: Converts the month part of the date
Transcribed Image Text:The image displays a Python script designed to convert a date from the format "MM/DD/YYYY" to a long date format such as "Month Day, Year." Below is the transcription and explanation of the code: ```python def main(): MonthNum=0;MonthName='';DateString='';Day=0;Year=0;LongDate='' LongDate=processing(MonthNum,MonthName,Day,Year) Display(LongDate) def processing(MonthNum,MonthName,Day,Year): MonthList=['January','February','March','April','May','June','July','August','September','October','November','December'] DateString=input('Enter a date in the format MM/DD/YYYY: ') DateList=DateString.split('/') MonthNum = int(DateList[0]) Day= DateList[1] Year=DateList[2] MonthName=MonthList[MonthNum -1] LongDate= MonthName + ' ' +Day+ ', '+Year return LongDate def Display(LongDate): print(LongDate) main() ``` ### Code Explanation - **Function Definitions:** - `main()`: This is the main function that initializes variables and calls `processing()` and `Display()`. - `processing()`: This function takes month, day, and year as inputs and converts the date from "MM/DD/YYYY" format to a long date string by extracting the month name from a list of month names. - `Display()`: This function prints out the long date format. - **Variables:** - `MonthNum`: Stores the numeric value of the month. - `MonthName`: Holds the name of the month (e.g., January). - `DateString`: A string where the user inputs the date. - `Day`, `Year`: Variables to store day and year extracted from `DateString`. - `LongDate`: A formatted string combining `MonthName`, `Day`, and `Year`. - **Logic:** - `MonthList`: A list containing all month names. - `DateString=input(...)`: Prompts the user to enter a date. - `DateList=DateString.split('/')`: Splits the date string into a list using the '/' as a delimiter. - `MonthNum = int(DateList[0])`: Converts the month part of the date
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY