Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Really have no idea why I keep encountering this problem: * see picture * Your first unit test test 1 0 Compilation failed isLeapYear.cpp: In

Really have no idea why I keep encountering this problem: *see picture*Your first unit test test10
Compilation failed
isLeapYear.cpp: In function 'int testPassed(std::ofstreame)':
isLeapYear.cpp:32:9: error: 'test1' was not declared in this scope
Compilation failed
isLeapYear.cpp:44:9: error: 'test2' was not
*My code*#include
// Function to determine if a year is a leap year
bool isLeapYear(unsigned int inputYear){
// Check if the year is divisible by 4
if (inputYear %4==0){
// If the year is a century year, it must also be divisible by 400 to be a leap year
if (inputYear %100==0){
return inputYear %400==0;
}
// If not a century year, it is a leap year
return true;
}
// If not divisible by 4, it is not a leap year
return false;
}
int main(){
// Example usage
unsigned int year1=1712;
std::cout "Year " year1" is a leap year: " std::boolalpha isLeapYear(year1) std::endl;
unsigned int year2=1913;
std::cout "Year " year2" is a leap year: " std::boolalpha isLeapYear(year2) std::endl;
return 0;
}
image text in transcribed

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

Students also viewed these Databases questions