Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. 120 points] Write a program that takes a date in the following format: December 25th, 2018 and extracts the day, month, and year as

image text in transcribed
2. 120 points] Write a program that takes a date in the following format: December 25th, 2018 and extracts the day, month, and year as 3 integers. You may want to use the following functions: (a) Write a function get Date that prompts a user to enter a date as a string and retuns (b) Write a function extract that takes as its parameter a date and retuns the day (c) Write a function convertDigits that takes as its parameter a string of digits and (d) Write a function convertMonths that takes as its parameter a month as a string it. month, and year as 3 integers. converts it to an int. and returns a corresponding number from 1 to 12 (1 for January,..., 12 for Decem- ber). (e) Write a program that repeatedly prompts the user to enter the date in the previous format. The program should then output it as in the examples below For example, Enter a date - December 25th, 2018 25/12/2018 Try again (Y/N) Y Enter a date -February 29th, 2018 29/2/2018 Try again (Y/N) -- Y Enter a dateFebruary 2nd, 2018 2/2/2018 . Try again (Y/N) N

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+3. Why is digital convenience important?

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago

Question

3.What are the Importance / Role of Bank in Business?

Answered: 1 week ago