Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LeapYear.cpp , which contains the following functionality Given the following rules, write a function that determines if a year is a leap year or not

LeapYear.cpp, which contains the following functionality

Given the following rules, write a function that determines if a year is a leap year or not (4 digit integer) and tell whether the given year is a leap year.

1) The function determines if a year is a leap year based on the criteria given below:

  • There were no leap years before 1752.
  • If the year divides by 400 then it is a leap year.
  • All years that divide by 100 are not leap years.
  • All years that divide by four are leap years. For example, 1800,1900 aren't leap years but 2000 will be; 1904, 1908,...,1996 were/will be leap years.)

2) If it is a leap year, the function adds it to an array that contains all the leap years within a specified range eg. 1700 - 2300

The file LeapYear.cpp must NOT contain a main() function.

Driver.cpp contains the main() function which:

1) Calls the functions in LeapYear.cpp and passes the range of years (1700 - 2300)

2) Gets a templated vector of leap years within that range and displays the first 10 elements of that array.

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions