Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello there,,, i need help is this html/javascript format. simple javascript to

ID: 669476 • Letter: H

Question

Hello there,,,

i need help is this html/javascript format. simple javascript to do "eastern sunday date" im just a littel lost on the algorithm format. a pop up screen is fine like the ones in "please enter a date" box.

2. Easter Sunday Date

You can calculate the date for Easter Sunday for any year from 1982 to 2048 as follows:

a is year % 19
b is year % 4
c is year % 7
d is (19 * a + 24) % 30
e is (2 * b + 4 * c + 6 * d + 5) % 7

Easter Sunday is March (22 + d + e), notice that this formula can result in a day in March that doesn't exist. That means the day is in April. Use an if statement to figure that out.

Prompt the user for a year and then output the date of Easter Sunday that year. If the year is before 1982 or after 2048, output an error message.

For example input of 1985, you should output "Easter is Sunday, April 7, in 1985"

Explanation / Answer

<!DOCTYPE html>
<html>
<body>

<button>Click here to find Easter</button>

<script>
function myFunction() {
var year= prompt("please enter a year (yyyy format)");
if (year >= 1982 && year <= 2048) {
a = year % 19;
b = year % 4;
c = year % 7;
d = (19 * a + 24) % 30;
e = (2 * b + 4 * c + 6 * d + 5) % 7;
day = (22 + d + e);
if(day>31){
alert("Easter is Sunday, April "+day%31+", in "+year);
}else{
alert("Easter is Sunday, March "+day%31+", in "+year);
}

}else{
alert("Please enter year between 1982 and 2048");
}
  
}
</script>

</body>
</html>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote