Last updated: 2017-08-23 6:45pm
Frequently asked questions about the assignment will be answered here.
If you have questions that aren't answered here, please ask them on the main assignment 0 page , not here. Those questions and their answers may be added to this FAQ.
Yes, you are allowed to create your own functions, which you will call from the getLocalTime function. It would be a very good idea to make use of your own functions, as it would be very hard to design a nice solution without making use of your own functions.
Yes. You're given the day and the month, and you can assume the year will always be 2017.
The day and month that you're given will be in UTC time.
8am would be "0800" in 24 hour time; however, we can't add zeroes to the start of a number in C, so "0800" would be represented as the number "800".
(e.g. a city of -1, a month greater than 12, etc)
No, you can assume that your function will only be given valid input. You don't need to check for cases where the input is invalid.
Nope, you can only use syntax that was covered at the point the assignment was released. This means you can use if statements and functions, but not loops or arrays etc.
Nope, the only thing you need to do is write the getLocalTime function. You don't need to worry about scanning or printing anything.
You can use the main function for unit tests (like the stub code has already), where you type out by hand (rather than scanning in) what the inputs should be, and what the expected output is.
No. However, you shouldn't be using any of those values directly -- e.g. you shouldn't be checking "if (city == 0)" instead of "if (city == CITY_ADELAIDE)" -- I would consider that incorrect.
Similarly, you shouldn't be using the timezone offsets directly -- e.g. rather than saying something like "localTime += 1100" for something that's in AEDT, you should say "localTime += TIMEZONE_AEDT".
They're a way of specifying "true" and "false" in your program, so if you had a function that did something like "determine if a number is even", it would return TRUE; or return FALSE;
You don't have to use them in your solution, but if you have functions at any point that return a yes/no or true/false value, it would be best to use the #defined values.
Yes, otherwise your program won't correctly calculate the local time.
It's entirely possible -- everybody makes mistakes.
First, check the assignment stub code to see whether it has been fixed there. If it's not fixed there, check out the comments at the bottom of the assignment page -- has somebody else asked the same question? If not, try using an online timezone converter to check the test manually.
If you still think the unit test might be wrong, then comment on the assignment page and we'll have a look.
Resource created Monday 14 August 2017, 09:18:46 PM, last modified Monday 12 February 2018, 05:00:50 PM.