Question: Can you help me write a program in c for this? 4. Write a program that takes in a date from the user and stores
4. Write a program that takes in a date from the user and stores it in struct date.t, that has 3 elements unsigned short month, unsigned short day, unsigned short year. unsigned means the integer is either positive or zero. Use the token %hu for unsigned shorts in your format strings. Then calculate the zodiac sign for that date. For example, if the date entered is 8/28/12, you should print out August 28, Virgo. For zodiac dates use the Tropical Zodiac columns found in the table at http://en.wikipedia.org/wiki/Zodiac Don't forgot about leap years, but how you handle them is a design decision. You can determine if a year is a leap year by using the following: if (year % 4--O && year % 100 !-0) ll year % 400-_ 0) /leap year/ else /* not a leap year / You have to use the enumeration ienum month JAN 1, FEB, MAR, APR, MAY, JUNE, JUL, AUG, SEPT, 0CT, NOV, DEC in your code. Add a menu system asking if the user wants to keep entering a date or if they want to exit from the program. See below for an example of a simple menu system. Save this as lab4.q4.c and make a script called lab4.q4.script
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
