Petrol Pump Management

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 11

TERM PAPER ON CALENDAR

(WITH REFERENCE TO COURSE: - OBJECT


ORIENTED PROGRAMMING)

SUBMITTED TO: MS. RAMINDER KAUR

SUBMITTED BY: ARUSH BANSAL ROLL NO: - B2804 B35

ACKNOWLEDGEMENT
We are indebted to our teachers and gurus who moulded at this junction of our career from where we can take off better in the competitive scenario of todays world. First of all, I would like to thank Almighty for his gracious blessing without whom I would not have been able to complete my project work. My special thanks is due towards Ms. Raminder Kaur for assigning me this topic (Calendar) and also for showering me the right path and guided me and solved all my queries and also encouraged me to go ahead with my project, without his help the project would have not turned out to be so meaningful Last but not the least I would like to thank my parents for their kind support.

THANK YOU

TABLE OF CONTENTS

INTRODUCTION DIFFERENT TYPES OF CALENDAR 1. Purely lunar calendars 2. Purely solar calendars 3. Solilunar calendars
4.

Arithmetic and astronomical calendars

5. Lunisolar calendars
6.

Complete and incomplete calendars

USES OF CALENDAR

CALENDAR CODE IN C++

INTRODUCTION
A calendar is a system by which time is divided into days, weeks, months, and years and organizing those days for social, religious, commercial, or administrative purposes. The name given to each day is known as a date. Periods in a calendar (such as years and months) are usually, though not necessarily, synchronized with the cycle of the sun or the moon.

DIFFERENT TYPES OF CALENDAR


Most calendars are designed according to the temporal cycles provided by motion or apparent motion of the Sun and moon which usually attempt to accord either with the cycle of the seasons (solar cycle) or with the cycle of the phases of the Moon (lunar cycle) or with both. There are over calendars currently in use, and many others that have been used or have been invented. They may be divided into following kinds as follows:-

1. PURELY LUNAR CALENDARS


Purely lunar calendars are those which are based on the natural cycles of the Moon, whose years (composed of months) have no close relation with the solar cycle, as the length of the lunar month is not even a fraction of the length of the tropical year, a purely lunar calendar quickly drifts against the seasons, which don't vary much near the equator , however it stays constant with respect to other phenomena, notably tides. Example, the Islamic calendar or Muslim Calendar

2.PURELY SOLAR CALENDARS


Purely solar calendars are those calendars which are based on the cycle of the seasons, which results from the motion of the Earth around the Sun (and the fact that the Earth's axis of rotation is tilted significantly with respect to the Earth's plane of rotation about the Sun). These calendars have years which accord with the seasonal cycle and begin at or near a fixed point in that cycle (for example, the vernal equinox). Years in a purely solar calendar may be composed of months, but the months have little or no connection with the lunar cycle Example, the Common Era Calendar (the Gregorian calendar with years designated according to the astronomical system)

1. LUNISOLAR CALENDARS These calendars aim to be both solar calendars and lunar calendars. These

calendars consist of years which accord closely with the seasonal cycle and months which accord more-or-less closely with the lunar cycle. Example, Liberalia Triday Calendar (which is unusual in that it has both a solar calendrical component and a lunar calendrical component, the solar component being more accurate than the lunar).

2. SOLILUNAR CALENDARS These calendars aim to be both solar calendars and lunar calendars, but are more successful in tracking the lunar cycle than the seasonal cycle. They consist of months which accord closely with the lunar cycle and years which accord moreor-less closely with the seasonal cycle Example, the Chinese calendar, the Jewish calendar and the Meyer-Palmen Solilunar Calendar.

3. ARITHMETIC AND ASTRONOMICAL CALENDARS


An astronomical calendar is based on ongoing observation;. Such a calendar is also referred to as an observation-based calendar. The advantage of such a calendar is that it is perfectly and perpetually accurate. The disadvantage is that working out when a particular date would occur is difficult. Examples, the religious Islamic calendar and the old religious Jewish calendar in the time of the Second Temple An arithmetic calendar is one that is based on a strict set of rules, such a calendar is also known as a rule-based calendar. The advantage of such a calendar is the ease of calculating when a particular date occurs. The disadvantage is imperfect accuracy. Example, current Jewish calendar

4. COMPLETE AND INCOMPLETE CALENDARS


Calendars may be either complete or incomplete. Complete calendars provide a way of naming each consecutive day, while incomplete calendars do not. Example of an incomplete calendar is The early Roman calendar, which had no way of designating the days of the winter months other than to lump them together as "winter",, while the Gregorian calendar is an example of a complete calendar.

CALENDAR CODE IN C++

#include<iostream.h> int c; int day; int date; int month; int main () { c=0; cout<<"\t\t\t::CALENDAR::\n"<<endl; cout<<"\n enter number of month:"<<endl; cin>>month; cout<<"\n\n enter first day of the month: \t"; cout<<"\n\n Monday = 0\nTuesady = 1\nWednesday = 2"; cout<<"\n Thursday = 3\nFriday = 4\nSaturday = 5"; cout<<"\n Sunday = 6\n"; cin>>day; cout<<"\n\n\t\t"; while (month<=12) { if (month==1) cout<<"JANUARY"; else if (month==2) cout<<"FEBRUARY"; else if (month==3) cout<<"MARCH"; else if (month==4) cout<<"APRIL"; else if (month==5) cout<<"MAY"; else if (month==6) cout<<"JUNE";

else if (month==7) cout<<"JULY"; else if (month==8) cout<<"AUGUST"; else if (month==9) cout<<"SEPTEMBER"; else if (month==10) cout<<"OCTOBER"; else if (month==11) cout<<"NOVEMBER"; else if (month==12) cout<<"DECEMBER"; else { cout<<"invalid month, calendar will close"; return 0; } cout<<"\n\nMon\tTue\tWed\tThu\tFri\tSat\tSun\n"; while (c<day) { cout<<"\t"; c++; } if (month==4||month==6||month==9||month==11) { for (date=1;date<31;date++) { ++c; cout<<date; cout<<"\t";

if (c%7==0) {cout<<"\n"; }

} } else if (month==2) { for (date=1;date<29;date++) { ++c; cout<<date; cout<<"\t";

if (c%7==0) {cout<<"\n"; } } } else {for (date=1;date<=31;date++) { ++c; cout<<date; cout<<"\t";

if (c%7==0) {cout<<"\n"; } } } month++; cout<<"\n\n"; } cout<<"\n\n"; return 0;

USES OF CALENDAR
The primary use of a calendar is to identify days, to be informed about and/or to agree on a future event and to record an event that has happened. Days may be significant for civil, religious or social reasons. For example, a calendar provides a way to determine which days are religious or civil holidays, which days mark the beginning and end of business accounting periods, and which days have legal significance, such as the day taxes are due or a contract expires. Also a calendar may, by identifying a day, provide other useful information about the day such as its season. Calendars are also used to help people manage their personal schedules, time and activities, particularly when individuals have numerous work, school, and family commitments. People frequently use multiple systems, and may keep both a business and family calendar to help prevent them from over committing their time. Calendars are also used as part of a complete timekeeping system: date and time of day together specify a moment in time. In the modern world, written calendars are no longer an essential part of such systems, as the advent of accurate clocks has made it possible to record time independently of astronomical events.

Bibliography
http://www.cplusplus.com/forum/general/4349/ http://www.scripts.com/c-and-cplusplus-scripts/calendar-scripts/ http://www.codeproject.com/KB/datetime/calarmclock.aspx

You might also like