Practice Assignment 2 Question 3

25 views
Skip to first unread message

16.j...@gmail.com

unread,
Oct 16, 2020, 12:02:25 PM10/16/20
to Discussion forum for Computational Thinking
Dear Sir/Madam,

In the Lecture the professor has mentioned Date as an integer. if so shouldn't the Date in the line 3 of Question 3 in practice Assignment be initialized to 0?

Regards,
Janani G

Anand Iyer

unread,
Oct 17, 2020, 12:18:23 AM10/17/20
to Discussion forum for Computational Thinking, 16.j...@gmail.com
Date is not an integer, at least as far its practical use is concerned.

Now, as for the lecture, professor was mentioning about a workaround.  So, if you're dealing with a single year, you could indicate each date as an integer.  1-Jan as 0, 2-Jan as 1...31-Dec as 364.

However, pls note this isn't always a practical solution, since you'll typically deal with multiple years as part of your data.  If you've to represent the birthdate of a person, you'll not able to use this technique, since there's no way to represent the year.
Reply all
Reply to author
Forward
0 new messages