Question: Lookup the System.DateTime structure. This type contains a large amount of functionality that allows a user to perform all sorts of interesting operations with dates
Lookup the System.DateTime structure. This type contains a large amount of functionality that allows a user to perform all sorts of interesting operations with dates and times. Use System.DateTime along with System.Console to implement a simple C# program that does the following:
Ask the user for their birthday. It will probably easiest to ask year, then month, then day rather than parsing a combined string reliably.
Calculate the age of the user.
Check to see if the age of the user is impossible. For example, if the user is not yet born, output an error message. If the user claims to be 135 years old, then let them know that's not possible.
Output the age of the user to the console.
If it is the user's birthday, output a nice message.
Compute the user's astrological sign according to both the Western (sun sign) and Chinese astrological systems. If you are not familiar with these astrological systems, look them up on the web.
Output the computed signs to the console. Optionally output additional information (e.g. horoscope of the day) about the user based on their sign.
Grading Criteria: Exe file (compiled version) submitted. 2 Source files submitted. 2 Program compiles as submitted. 2 Program has no logic errors. 3 Program uses System.DateTime to store the current date and the user-entered birth date. 3 Program validates user-entered birth date. 3 Program correctly calculates age of user. 3 Program displays age of user. 3 Program displays a birthday message, if appropriate. 3 Program correctly determines the Western and Chinese astrological signs for the birthdate entered. 3 Program displays the Western and Chinese astrological signs. 3 (Bonus) Program outputs additional information based on the signs. 3
*Add comments to code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
