User Tools

Site Tools


notes:cprog:fall2023:projects:mmf0

This is an old revision of the document!


MMF0

Process

Input value as short int (all four digits)

Obtain the last two digits of this input value

Quarter the value

Add quartered value back to two digit year

Subtract best fitting multiple of seven

Look up day in table

Day Value
Monday 1

Edge case: leap years

SELECTION

if statements

else if

else

RELATIONAL OPERATORS

Operator Description
== is equal to

VERIFY RESULTS

To verify your results, ./mmf0verify

Remember to only use stdout to print the days of the week [EX: fprintf(stdout, “Monday\n”)]. If stdout is used for anything other than the days of the week, the mmf0verify will say you have a mismatch for every year, even if you get the correct day when you run your compiled code. If you want to print something other than the days of the week, use stderr.

notes/cprog/fall2023/projects/mmf0.1694709618.txt.gz · Last modified: 2023/09/14 16:40 by jmerri10