Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question #2-Formatting the year (60 marks) Write a Cprogram named q2calendar.c that prints one year's full calendar to standard output. 1. Accept exactly 2 command-line
Question #2-Formatting the year (60 marks) Write a Cprogram named q2calendar.c that prints one year's full calendar to standard output. 1. Accept exactly 2 command-line arguments that control the calendar details Maximum number of characters DAYSIZE to print for the day-of-week labels, which must be 2 or greater The day-of-week that starts the year FIRSTDAY as an integer from 1 to 7 (1 is Sunday in English) a. b. 2. Your output must precisely follow the format specification given by the following examples, so you should make sure you can replicate them precisely. Note that the examples were cut off at April only because we ran out of space on the page. The output must continue until Dec 30th The full text specification of this format is on the next page Sgcc q2_calendar.c -o q2_calendar 2 calendar 1 5 2alendar $ ./q2_calendar 2 1 gcc q2 calendar.C- calendar /q2 calendar i3 ERROR: Cannot print days snaller than stze 2 /2 calendar 58 ERROR: The first day of the week rust be between 1 and 7 42 calendar 18 7 January Sunday IMondayTuesday I Wednesday ThursdayFrtdeySaturday 12 13 14 15 16 17 819 10 1 1112 13 1419 15 I 16 I 17 I 18 I 19 I 20 I 21 22 23 | 24 | 25 26 | 27 | 28 I30 February Sunday Monday ITuesday IWednesday I ThursdayFrtday Saturday 1 1 12 1314 15I 6 17 1819 10 11 12 13 14 | 1516 | 17| 18| 19 I 20 | 21 | 22| 23| 24 | 25 | 26 I 27 | 28| 291 30I l Sunday IMondayTuesday I Wednesday IThursdayFrtdaySaturday March eril 4 5 16718 19 10i 11 I 12 I 13 I 14 I 15 I 16 I 17 18 I 19 I 29 I 21 I 22 I 23 I 24 I 25 | 26 | 27|28 | 29 30 April I Su | Mo | Tu | We I Th | Fr | Sa
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started