Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please complete the following using C coding language. for number 2. create a separate driver function the script file is not needed. ulianized or Ordinal

image text in transcribed

image text in transcribed

image text in transcribed

please complete the following using C coding language.

for number 2. create a separate driver function the script file is not needed.

ulianized or Ordinal Date An ordinal date is a calendar date consisting of a year and a day, starting on January 1. It is always a number between 1 and 366 . The first day of every year is January 1 . The second day of every year is January 2 . The thirty-first day of every year is January 31. The thirty-second day of every year is February 1. The thirty-third day of every year is February 2. The fortieth day of every year is February 9 . February 28 is the 59th day of every year. If the year is a leap year, then the 60th day of the year is February 29 , otherwise the 60th day of the year is March 1st. And so on. For example, the julianized date of April 15 is 90+15=105 in a common year, and 91+ 15=106 is a leap year. Casks 1. Create a function that returns true or false. Write a function is_a_leap_year ( ) which returns true if the year that is passed in is a leap year, false otherwise. For example, 2019 is not a leap year, so the function would return false. But 2020 is a leap year, so it would return true. 2. Write a batch driver to test your leap year function. Create a separate program to test your program with all the years that appear above in the Background section. Submit the driver and the output with your assignment. 3. Create a function to validate a month, day, and year value. Write a function is_a_validate_date ( ) which accepts three values, representing the month, day, and year. Have the function check the month is a value between 1 and 12 , the day is a value between 1 and 31 , and the year is a value between 1900 and 2200 . If the date is valid, return true. If it is invalid, return false. 4. Create a function to prompt the user to enter a date. Write a function get_date ( ) which prompts the user to enter a month, a day, and a year. 5. Create a function to calculate the number of days that have passed in the current year. Write a function ordinal_date ( ) that accepts a year, month, and day and uses IF statements to calculate the julianized date. 6. Create functions to display a date and an ordinal date Write a function print_US_date ( ) that prints out a date formatted the way it is done in the United States, which is MM/DD/YYYY as in March 20, 2019 being 03/20/2019 Also create a function print_ordinal_date ( ) that prints out a julianized date, which is YYYYDDD as in March 20, 2019 being 2019079 7. Write a complete program. Put all your functions together to create a complete main( ) program. The main() function itself should consist only of function invocations. The program will prompt the user to enter a date, validate it (or print an error if it's not valid and end), calculate the julianized date, and display the answer for the user. MM/DD/YYYY is the YYYYDDD

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_2

Step: 3

blur-text-image_3

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

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

Discuss the role of intuition in strategic analysis and choice.

Answered: 1 week ago

Question

What is a business model?

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago