Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following algorithm. 1. ???????? ? Input a four digit year. 2. if (???????? mod 4 = 0) { Divisible by 4 } 2.1

image text in transcribedConsider the following algorithm. 1. ???????? ? Input a four digit year. 2. if (???????? mod 4 = 0) { Divisible by 4 } 2.1 if (???????? mod 100 = 0) { Divisible by 100 } 2.1.1 if (???????? mod 400 = 0) {Divisible by 400} 2.1.1.1 isLeapYear ? TRUE; 2.1.2 Else 2.1.2.1 isLeapYear ? FALSE; 2.1.3 End if 2.2 Else { Not divisible by 100} 2.2.1 isLeapYear ? TRUE; 2.3 End if 3. Else { Not divisible by 4 } 3.1 isLeapYear ? FALSE; 4. End if 5. Output isLeapYear a) Trace the algorithm starting with the input 1500. b) Document the changes that would need to be made to the algorithm after step 4 to output the number of days in a specific year. Make sure that you describe the changes in detail.

Question 3 [6 marks] Consider the following algorithm. 1. year - Input a four digit year 2. if (year mod 4 - 0 Divisible by 4) 2.1 if (year mod 100 = 0) { Divisible by 100, 2.1.1 if (year mod 400visible by 400) 2.1.1.1 isLeapYear

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

Students also viewed these Databases questions

Question

What is the environment we are trying to create?

Answered: 1 week ago

Question

How would we like to see ourselves?

Answered: 1 week ago

Question

How can we visually describe our goals?

Answered: 1 week ago