Program 6 Date Manipulation and Roman Numerals Using the datetime and roman Modules You are to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Program 6 Date Manipulation and Roman Numerals Using the datetime and roman Modules You are to write a program which uses the Python datetime and roman modules. Videos that I placed in Blackboard that will be helpful for this assignment are: Python_pip_Command Python_roman_module Python_datetime_module Your program should prompt the user for a birth date in the form mm/dd/yyyy and output the person's birth date and "exact" age in both "normal" and "roman" format. Since most of us probably do not know exactly what time of day we were born, we will not calculate our age down to, or display any information related to, hours, minute and seconds. The output should be similar to that shown on Attachment A. General Requirements You should check to see if the information inputted by the user is correct in format. If it is not, you should output an appropriate error message and have the program terminate. Your program should accept 1 or 2 digit months and 1 or 2 digit days. (Examples of valid input are 01/03/2001, 1/3/2001, 10/5/1960, etc.) If the user specifies a birth data that is in the future, your program should output an appropriate error message and terminate. Normal Terms When outputting a person's birthday date you are to output the month as January, February, March, etc. instead of the numeric value that was inputted by the user. If the day of birth had a leading zero, do not output the leading 0. If this is the case, there should not be extraneous spaces in the output. (For an example, see the first execution shown in Attachment A) When outputting the person's age you should specify the number of years, months, weeks, days (do not include hours, minutes, or seconds). Also, if the any of these values is zero, you should not output them. (For an example, see the third execution shown on Attachment A). Roman Terms All numeric values are to be displayed as roman numerals. All zero values in the age output should be omitted. The information related to the month of birth should come from this table: Month of Birth January February March April May June July August September October November December Outputted Information Januarius (Named after the god Janus) Februarius (Named after Februa, the purification festival) Martius (Named after the god Mars) Aprilis (Named after the goddess Aphrodite) Maius (Named after the goddess Maia) Junius (Named after the goddess Juno) Julius (Named after Julius Caesar in 44 BC. Quintilis previously) Augustus (Named after Emperor Augustus in 8 BC. Sextilis previously) September (From the word septum, meaning 7) October (From the word octo, meaning 8) November (From the word novem, meaning 9) December (From the word decem, meaning 10) Test Cases You must run your program for the two dates shown in Attachment A, your birth date, and then run any other additional test cases you may need to demonstrate that all portions of your program function properly. Additional Information To output the date on which your program is executed, and to calculate a person's age, you will need the current date which can be obtained via the datetime now() method or the UNIX date command. When displaying the date on which your program is executing DO NOT display the current time. Attachment A wbeech0001@grace$ pgm6.pl This program is being run on Mar 25, 2001 Input a birthdate in the form mm/dd/yyyy: 10/05/1960 In "normal" terms: The person was born October 5, 1960 The person is 40 years 5 months 2 weeks 6 days old In "Roman" terms: The person was born on the V day of the month named October (From the word octo, meaning 8) in the year MCMLX The person is XL years V months II weeks VI days old wbeeche001@grace$ pgm6.pl This program is being run on Mar 25, 2001 Input a birthdate in the form mm/dd/yyyy: 3/8/1938 In "normal" terms: The person was born March 8, 1938 The person is 63 years 2 weeks 3 days old In "Roman" terms: The person was born on the VIII day of the month named Martius (Named after the god Mars) in the year MCMXXXVIII The person is LXIII years II weeks III days old wbeech0001@grace$ pgm6.pl This program is being run on Mar 25, 2001 Input a birthdate in the form mm/dd/yyyy: 3/23/1980 In "normal" terms: The person was born March 23, 1980 The person is 21 years 2 days old In "Roman" terms: The person was born on the XXIII day of the month named Martius (Named after the god Mars) in the year MCMLXXX The person is XXI years II days old wbeeche001@grace$ Program 6 Date Manipulation and Roman Numerals Using the datetime and roman Modules You are to write a program which uses the Python datetime and roman modules. Videos that I placed in Blackboard that will be helpful for this assignment are: Python_pip_Command Python_roman_module Python_datetime_module Your program should prompt the user for a birth date in the form mm/dd/yyyy and output the person's birth date and "exact" age in both "normal" and "roman" format. Since most of us probably do not know exactly what time of day we were born, we will not calculate our age down to, or display any information related to, hours, minute and seconds. The output should be similar to that shown on Attachment A. General Requirements You should check to see if the information inputted by the user is correct in format. If it is not, you should output an appropriate error message and have the program terminate. Your program should accept 1 or 2 digit months and 1 or 2 digit days. (Examples of valid input are 01/03/2001, 1/3/2001, 10/5/1960, etc.) If the user specifies a birth data that is in the future, your program should output an appropriate error message and terminate. Normal Terms When outputting a person's birthday date you are to output the month as January, February, March, etc. instead of the numeric value that was inputted by the user. If the day of birth had a leading zero, do not output the leading 0. If this is the case, there should not be extraneous spaces in the output. (For an example, see the first execution shown in Attachment A) When outputting the person's age you should specify the number of years, months, weeks, days (do not include hours, minutes, or seconds). Also, if the any of these values is zero, you should not output them. (For an example, see the third execution shown on Attachment A). Roman Terms All numeric values are to be displayed as roman numerals. All zero values in the age output should be omitted. The information related to the month of birth should come from this table: Month of Birth January February March April May June July August September October November December Outputted Information Januarius (Named after the god Janus) Februarius (Named after Februa, the purification festival) Martius (Named after the god Mars) Aprilis (Named after the goddess Aphrodite) Maius (Named after the goddess Maia) Junius (Named after the goddess Juno) Julius (Named after Julius Caesar in 44 BC. Quintilis previously) Augustus (Named after Emperor Augustus in 8 BC. Sextilis previously) September (From the word septum, meaning 7) October (From the word octo, meaning 8) November (From the word novem, meaning 9) December (From the word decem, meaning 10) Test Cases You must run your program for the two dates shown in Attachment A, your birth date, and then run any other additional test cases you may need to demonstrate that all portions of your program function properly. Additional Information To output the date on which your program is executed, and to calculate a person's age, you will need the current date which can be obtained via the datetime now() method or the UNIX date command. When displaying the date on which your program is executing DO NOT display the current time. Attachment A wbeech0001@grace$ pgm6.pl This program is being run on Mar 25, 2001 Input a birthdate in the form mm/dd/yyyy: 10/05/1960 In "normal" terms: The person was born October 5, 1960 The person is 40 years 5 months 2 weeks 6 days old In "Roman" terms: The person was born on the V day of the month named October (From the word octo, meaning 8) in the year MCMLX The person is XL years V months II weeks VI days old wbeeche001@grace$ pgm6.pl This program is being run on Mar 25, 2001 Input a birthdate in the form mm/dd/yyyy: 3/8/1938 In "normal" terms: The person was born March 8, 1938 The person is 63 years 2 weeks 3 days old In "Roman" terms: The person was born on the VIII day of the month named Martius (Named after the god Mars) in the year MCMXXXVIII The person is LXIII years II weeks III days old wbeech0001@grace$ pgm6.pl This program is being run on Mar 25, 2001 Input a birthdate in the form mm/dd/yyyy: 3/23/1980 In "normal" terms: The person was born March 23, 1980 The person is 21 years 2 days old In "Roman" terms: The person was born on the XXIII day of the month named Martius (Named after the god Mars) in the year MCMLXXX The person is XXI years II days old wbeeche001@grace$
Expert Answer:
Answer rating: 100% (QA)
To create the program according to the given specifications youll need to use Pythons datetime module to handle daterelated operations and the roman m... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
How do we solve labor problems? The government of the united states changes their position as regards the ever present conflict between labor and management. At one times, it tilts towards labor and...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
In this programming assignment you will practice using ArrayLists, Inheritance and Polymorphism. You are to write a game called Magical Creatures War. You will do this by implementing a class called...
-
Consider an asset allocation problem with one risky asset and one risk-free asset .There are four investors .Each investor maximizes a mean-variance utility function to make their optimal investment...
-
1. Is SAP's corporate structure hindering its competitive advantage? 2. What corporate strategies has SAP used to remain competitive? 3. How has SAP's business-level strategies sustained them...
-
A study found that radar detector users have lower accident rates, wear their seat belts more, and even vote more than nonusers. (a) Assuming that the study is accurate, do you think there is...
-
Describe the documents that underlie the typical accounting system for sales. Give an example of a failure of internal control that might occur if these documents were not properly prepared. LO28
-
The new owners of Bluegrass Natural Foods, Inc., have hired you to help them diagnose and cure problems that the company has had in maintaining adequate liquidity. As a first step, you perform a...
-
Problem 3 (5 points) Sketch the graph of the following functions and find the limits: g (x ) x - 3 + 1, if x # 3 Find lim g(x), lim g(x), and lim g (x). 1 if x = 3 x-3+ X -3- x-3
-
You are planning to switch your cell phone provider. The Cellular worksheet presents three options for a cell phone plan with the new company. You could choose a pay-as-you-go plan, a traditional...
-
A company that has gained first-mover advantage is immune to competition. False True
-
Discuss the role of linear programming in procurement and supplier selection decisions to achieve cost savings and improve supply chain performance.
-
Organizational behavior Define organizational culture, and discuss the competing values cultural framework. Explain the importance of a fit between individual values and organizational culture. (250...
-
explain the various leaadership styles and discuss their silent features. which leadership style is best and why?
-
A rod of charge -3.70 nC is bent into a semicircle of radius R = 76.2 cm. A second rod, this one straight of charge +3.70 nC and length 2R, is placed a distance d = 4.90 cm from the semicircle, as...
-
As shown, a mass is being lifted by a strut that is supported by two cables AC and CD. The dimensions given are a = 6.90 ft, b= 4.50 ft, c = 9.50 ft, d = 3.70 ft, and e= 5.10 ft.(Figure 1) Part A...
-
Find the exact value of the following trigonometric expression. Do not use any trigonometric functions on a calculator or other technology, as they will not provide you with exact answers. Decimal...
-
What is an insurable interest? Why is it important?
-
Ann hires a nanny to watch her two children while she works at a local hospital. She pays the 19-year-old nanny $125 per week for 48 weeks during the current year. a. What is the employer's portion...
-
Indicate, in each of the following situations, the number of exemptions the taxpayers are entitled to claim on their 2012 income tax returns. Number of Exemptions a. Donna, a 20-year-old single...
-
Quince Corporation has taxable income of $450,000 for its 2012 calendar tax year. Calculate the corporation's income tax liability for 2012 before tax credits. $_________
-
Executive compensation is often based on meeting certain targets for revenue growth, earnings, earnings per share, return on assets, or other performance measures. But what if performance is not...
-
Go to the website for Moodys Investors Service. Click on ratings, which will show revisions of debt ratings issued by Moodys in the past few days. Choose a rating that has been upgraded or downgraded...
-
Divide into groups. Assume your group is analyzing the fate of the larger airlines, such as United and American. You have the following information: a. Between 1999 and now, the long-term debt,...
Study smarter with the SolutionInn App