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...
-
A molecule in a gas undergoes about 1.0 X 109 collisions in each second. Suppose that (a) Every collision is effective in deactivating the molecule rotationally and (b) That one collision in 10 is...
-
For the cascode amplifier circuit of Fig. 5.177, calculate the voltage gain Av and output voltage Vo- +20 V 7.5 kQ 50 uF 02 - 200 6.2 kQ 01 10 mV B 200 3.9 k2
-
The Wide World of Fluids article "Learning from Nature,". As indicated in Fig. P9.122, birds can significantly alter their body shape and increase their planform area, \(A\), by spreading their wing...
-
John's Custom Computer Shop (JCCS) assembles computers for both individual and corporate customers. The company is organized into two divisions: Personal and Business. Once a computer is built, it is...
-
A 1-kg ball moving with a velocity of 2 m/s to the right collides with a 2-kg ball moving with a velocity of 4 m/s to the left. The balls collide elastically and scatter at a 45-degree angle to their...
-
Pat and Mandy are married and have a son, Steve, age 8. Mandy, age 29, earns $40,000 annually from her job. Pat, age 31, earns $50,000 annually from his job. Assume that Pat will die before Mandy....
-
Explain, consisting of a minimum of 200 words, on the significance of Operations Specifications for air carriers. Share your perspective on the potential consequences if airlines were not required to...
-
Explain the concept of revenue recognition and the criteria for recognizing revenue. Discuss the importance of ethics in accounting and the potential consequences of unethical behavior.
-
Write the expression as one logarithm. 5 loga x + 3 * loga(x 9) 7 log,(5x + 8)
-
Corporate Stationery and Furniture Supplies Pty Ltd was acquired and registered as a company on 1 July 2021 under the rebranded name as listed. The company is classified as a Proprietary Limited (Pty...
-
In her book Dare to Serve, Cheryl Bachelder states that "it is easy to say that you want to serve others well, but it is much harder to do so in daily life. This topic is seldom discussed out in the...
-
As we begin to examine managerial economics in depth, let's consider the other values that should be considered and how to weigh them. What are the challenges across cultures, generations,...
-
Re-type the code and fix any errors. The code should convert non-positive numbers to 1. if (userNum > 0) else System.out.println("Positive."); System.out.println("Non-positive, converting to 1. ");...
-
Using Gauss-Jordan elimination, invert this matrix ONLY 0 0 0 0 1
-
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. $_________
-
Home Inc. (a US company) has a wholly-owned subsidiary, S, which it acquired on 1 January X0. The balance sheets of S as at 1 January X0 and 31 December X0 are as set out in Figure 15.1 in foreign...
-
An entitys functional currency is: A. The currency of its parents country. B. The currency of its own country. C. The currency in which the financial statements are presented. D. The currency of the...
-
Entity X based in one country (currency $) bought goods from Entity Y in another country (currency :) for :300,000 on 1 May 20X1. The spot rate on that date was $1 = :1. As at 31 December 20X1, the...
Study smarter with the SolutionInn App