How to resolve the algorithm Day of the week step by step in the Vedit macro language programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Day of the week step by step in the Vedit macro language programming language
Table of Contents
Problem Statement
A company decides that whenever Xmas falls on a Sunday they will give their workers all extra paid holidays so that, together with any public holidays, workers will not have to work the following week (between the 25th of December and the first of January).
In what years between 2008 and 2121 will the 25th of December be a Sunday? Using any standard date handling libraries of your programming language; compare the dates calculated with the output of other languages to discover any anomalies in the handling of dates which may be due to, for example, overflow in types used to represent dates/times similar to y2k type problems.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Day of the week step by step in the Vedit macro language programming language
Source code in the vedit programming language
Buf_Switch(Buf_Free)
for (#3 = 2008; #3 < 2122; #3++) {
Reg_Set(10, "12/25/")
Num_Str(#3, 10, LEFT+APPEND)
if (JDate(@10) % 7 == 0) {
Num_Ins(#3, NOCR)
}
}
You may also check:How to resolve the algorithm Sieve of Eratosthenes step by step in the NetRexx programming language
You may also check:How to resolve the algorithm Word frequency step by step in the Ring programming language
You may also check:How to resolve the algorithm Conway's Game of Life step by step in the C++ programming language
You may also check:How to resolve the algorithm Palindrome detection step by step in the Scala programming language
You may also check:How to resolve the algorithm Ackermann function step by step in the Wart programming language