Question: need help finishing this code. please help and zoom in if needed! Write a program that reads an integer which represents a year. The program

need help finishing this code. please help and zoom in if needed!

need help finishing this code. please help and zoom in if needed!

Write a program that reads an integer which represents a year. The

Write a program that reads an integer which represents a year. The program should then determine if the year was/is/will be a leap year (a year made up of 366 days.) A leap year is a year that is divisible by 4 with the following exception the centurial years that are divisible by 100 but not divisible by 400, such as 1700, 1800, 1900, and 2100, are NOT leap years. The century years that are divisible by 400, ARE leap years, for instance 1600, 2000, and 2400. Your previous leap year program used nested if-else constructs (and only nested if-else, no && or operators). Using the same divisiblity logic, this program should use one single condition involving logical and and or (& & and I 1) that represents the whole leap year condition Hint Here you will have a single if condition, such as the following: if ( ( (condition 1) && (condition 2)) || (condition 3)) { 17 year is a leap year else Il year is not a leap year } Your program should output one of the following statements based on whether or not XXXX is a leap year XXXX. is a leap year. XX.X.X. is not a leap year. When the input is as shown if Figure 1. your program should produce output as shown in Figure 2. Figure 1: (sample input) 2018 Figure 2 (sample output) 2018 is not a leap year. 5 #include 6 using namespce std; 7 int main() 9 { int year, condition 1, condition 2, condition 3; if ( ( (condition 1) && (condition 2)) || (condition 3)) 13 cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!