Access over 20 million homework & study documents

C++ program to create a console application that allows the user to access sunrise/sunset almanac da

Content type
User Generated
Subject
Computer Science
Type
Lab
Rating
Showing Page:
1/40
CPP Sunrise Sunset Alamac Data
Contents

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/40
Main.cpp





 
!"
#$
%&'
%('
%'
%'
%('
%'
()
(*+,-./0123 453*33*631723178379343
:!32:;34<)
&%'==>?0
&%'&@)
(A/(>?)
 A=/ >"?)
=/B)
C>D>=??0

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/40

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 40 pages?
Access Now
Unformatted Attachment Preview
CPP Sunrise Sunset Alamac Data Contents Main.cpp // CPPSunRiseSetAlmanac.cpp : Defines the entry point for the console application. // #include "city.h" #include "sun.h" #include "datefun.h" #include "ReadFile.h" #include "Text.h" #include "Keyboard.h" #include #include #include #include #include #include using namespace std; string Month[12] = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT","NOV","DEC"}; vector read_city_info() { vector vCityInfo; String* line= createString(""); ReadFile* f_cityinfo = createReadFile("cityinfo.txt"); int line_no = 0; while(!eof(f_cityinfo)){ line = append(readLine(f_cityinfo), line); ++line_no; if (line_no % 2 == 0){ city oCity(line); vCityInfo.push_back(oCity); destroyString(line); line = createString(""); } } close(f_cityinfo); return vCityInfo; } struct tm* getDate(int month, int day, int year){ time_t rawtime; time(&rawtime); struct tm* tm_ptr = localtime(&rawtime); if (tm_ptr){ tm_ptr->tm_year = year-1900; tm_ptr->tm_mon = month-1; tm_ptr->tm_mday = day; mktime(tm_ptr); } return tm_ptr; } struct tm* incrementDate(struct tm* sDate){ time_t rawtime = mktime(sDate); struct tm* tm_ptr = localtime(&rawtime); if (tm_ptr){ tm_ptr->tm_mday += 1; mktime(tm_ptr); } return tm_ptr; } bool considerDaylightSavin ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Awesome! Perfect study aid.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Documents