Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* Instruction: 1. run this c program and copy/past the output at the end of the source code 2. modify the program so that the

/* Instruction: 1. run this c program and copy/past the output at the end of the source code

2. modify the program so that the setDate() function will generate a randome month, day and year instead of using 6/3/2005 Note: be sure you handle the leap year case for february case.

*/

#include

/* declaration of the data structure */

struct Date

{

int month;

int day;

int year;

};

/* implementation of associated functions */

/* operation to assign values to a Date object */

struct Date setdate(int mm, int dd, int yyyy)

{

struct Date temp;

temp.month = mm;

temp.day = dd;

temp.year = yyyy;

return(temp);

}

/* operation to display a Date object */

void showdate (struct Date a)

{

printf("%02d/%02d/%02d", a.month, a.day, a.year % 100);

}

int main()

{

struct Date a;

a = setdate(6,3,2005);

printf(" The value of the a object is: ");

showdate(a);

printf(" ");

return 0;

}

Help solve please

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

Step: 3

blur-text-image

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

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago

Question

b. Why were these values considered important?

Answered: 1 week ago