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

Using the Round Robin Scheduler principle, write the algorithm to display the ca

ID: 3636285 • Letter: U

Question

Using the Round Robin Scheduler principle, write the algorithm to display the calendar of January 2012. The first day of January of the new year will be a Sunday

Hints:
- You create an array A of 7 singly linked lists of integers (1 to 31), where array A[0] is the list of Sundays, … A[5] is the list of Fridays, A[6] is the list of Saturdays.
You may then use A[i].Displays method to display a list

- Should have a good Java Class on Singlylinkedlist of Integer or generic.

- Should have a Java class Queue of integers implemented by Arrays or linkedlist.

- Should be able to create an Array of 7 Linkedlist, example:
Queue queue = new Queue();
SLinkedList [] a = new SLinkedList[7];
for (int i=0; i<7; i++)
{
a[i]= new SLinkedList();
}


i=0 corresponds to Sundays
i=1 to Mondays,
...
i=6 to Saturdays,

Explanation / Answer

Answer Details #include #include #include "scaldate.h" /* ** calendar generation information */ int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; char *month[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; char *daynames[8] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}; /* ** box drawing stuff */ #if defined(MSDOS) || defined(_WIN32) const char *topborder = "ÕÍÍÍÍÍÍÍÍÍÍÍ" "ÍÍÍÍÍÍÍÍÍÍÍÍ" "ÍÍÍ͸"; const char *midborder = "ÆÍÍÍÍÍÍÍÍÍÍÍ" "ÍÍÍÍÍÍÍÍÍÍÍÍ" "ÍÍÍ͵"; const char *botborder = "ÔÍÍÍÍÍÍÍÍÍÍÍ" "ÍÍÍÍÍÍÍÍÍÍÍÍ" "ÍÍÍ;"; const char *line = "³"; #else const char *line = ""; #endif /* ** tell 'em they messed up */ void usage(void) { puts("Usage: CAL [m y]"); puts("where: m = month (1 - 12)"); puts(" y = year (1 - 99, 1800 - 3000)"); exit(-1); } /* ** here's where the real work's done */ int main(int argc, char *argv[]) { int day, day_1, numdays, i, j; unsigned yr, mo; if (argc < 3 && argc > 1) usage(); if (argc >= 3) { yr = atoi(argv[2]); mo = atoi(argv[1]); } else { long dnow = today(); unsigned dy; scalar_to_ymd(dnow, &yr, &mo, &dy); } if (!mo || 12 yr) yr += 1900; if (3000 yr) usage(); for (i = 0, mo -= 1; i < 3; ++i, ++mo) { if (!mo) { mo = 12; --yr; } if (12
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