[Year 12 SofDev] 2 digit numbers
David Dawson
David.Dawson at wesleycollege.net
Fri Jun 4 12:10:14 EST 2010
This raises all sorts of entertaining questions.
In many languages "everything is a string" http://wiki.tcl.tk/14589 so
what do you do then? Are you only talking about VB.Net? How are integers
stored internally - and have you covered this in the course?
In tcl, PHP, Java and in C++, for example, you may need to cast int to
string and back again for effective calculation and/or display. The
display is always a character.
Hence, if I was your student and you did not specify how a two-digit
int is to be represented that 01, 02 etc would be a good response. They
could also argue that these screen "integers" are only characters that
represent a 4-byte binary in any case.
In fact, on many invoicing systems the numbering starts at 000001,
000002 etc.. so obviously this must be either a string or a cast
integer.
I hope this helps.
David Dawson
Head of Information Technology Learning Area
Head of Learning Technologies
St Kilda Rd Campus
Wesley College
577 St Kilda Rd
Melbourne 3004
Ph 8102 6340
Mob 0425 718147
>>> sofdev-bounces at edulists.com.au 06/04/10 11:04 am >>>
Hi all, I would appreciate some feedback.
On my last SAC I asked students to use a 2 digit code for stock
numbers. We use VB.Net and some student used 01,02 etc. I was looking
for 10-99 inc. some of my top students used 01, etc and will no doubt
want to argue the point with me.
01,02 are fine as text strings, but do they qualify as 2 digits when
stored as integers?
What do you think?
Thanks
Philip Pike
Director of ICT
Bacchus Marsh Grammar
Sth Maddingley Rd
Bacchus Marsh 3340
Ph 53664800 Ext 849
Fax 53664850
email: pikep at bmg.vic.edu.au
____________________________________________________________________________
Sapere Aude - Dare To Be Wise
Wesley College Melbourne is a world class coeducational independent school
developing the whole person through timeless principles of learning:
- to know
- to do
- to live with
- to be
with innovation and wisdom
ABN 38 994 068 473 CRICOS 00354G
____________________________________________________________________________
This email is intended only for the use of the individual or entity named
above and may contain information that is confidential and privileged. If
you are not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this email is strictly prohibited.
If you have received this email in error, please email a reply to Wesley
College and destroy the original message.
More information about the sofdev
mailing list