Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in C Rewrite the following program (Program 10.1 0) to read the Holidays.txt file into an array o f structures where each individual structure co

in C image text in transcribed
Rewrite the following program (Program 10.1 0) to read the "Holidays.txt" file into an array o f structures where each individual structure co nsists of an integer day, month, and year mem ber. sinclude estate, ho zinclude estdife,ho f needed for exit( / Adefine holloays 20 int htable[HOLToAYS]: f a global halidoy array +/ int main(2) Int getholidaysil); / * function prototype *f int i, cuallolidays: nuelolidays = getholidays(): f versify the inpot and sterage of the Nolidays * f printf("The Holiday array centains is halidaysln", nuniolidays ; ; printf (" and contains the elenents: (n" ); for ( 1 * 8;,1 1+ ) printf (d)", htable:i 1]); return E: int getholidays() char Holidayfile[] = "e: MesrecodelNolidays,txt"; f " change this to the "/ int 1 o b; ( poth vhere the flle is stored on *f int no, day, yr; /; yoor cobputer */ char del1, del2; fite "infile: infile = fopen ( Holidayfile,nn); i j open the file / / check for a successful open * / if (InFile = NULL) printf("Infalled to open the file N ") exit(1): read, colvert, and store each dute */ while (fscanf(infile, "Hetsctitsche", lno, Sdel1, Iday, Mdel2, IYr) EOF) htable[1] =yr12008+mo=12a+ day: ioli fclose ( infile); retarn

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

How could an organization's culture be used as a control mechanism?

Answered: 1 week ago

Question

What are the determinants of cash cycle ? Explain

Answered: 1 week ago