Computer Science Canada Quick question. (quick answer please) |
Author: | canmovie [ Fri Nov 23, 2012 11:23 am ] |
Post subject: | Quick question. (quick answer please) |
I'm stuck on the following question: A very large program that recorded employee salaries was written 15 years ago. All the salaries were of the datatype int, but now they have to be changed to floats. To change all the salaries to floats, many programmers now have to search through the code. How could this problem be prevented? My simple answer is that floats should've been used 15 years ago? Is that the right answer, or is there a better alternative? |
Author: | jbking [ Fri Nov 23, 2012 11:39 am ] |
Post subject: | Re: Quick question. (quick answer please) |
While that is an answer, I really dislike that kind of answer as it implies that one should just always know what to use for a datatype. When the request to change the datatype came in, what kind of analysis was done to determine why float should be used instead of money, double, or some other kind of data structure? That would be my response but then this does depend on the context of where are you getting this question. |
Author: | [Gandalf] [ Fri Nov 23, 2012 7:28 pm ] |
Post subject: | RE:Quick question. (quick answer please) |
Based on my extensive experience with school, this is not the answer they are looking for. The question is looking for a general answer, that will work regardless of the old type and the new type. What if instead of floats, they required some other arbitrary type? |
Author: | md [ Sat Nov 24, 2012 12:08 am ] |
Post subject: | RE:Quick question. (quick answer please) |
Locked, because you've already asked this question 3 times in other threads. |