Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 fonebook
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jimbo 420




PostPosted: Mon Jun 05, 2006 1:15 pm   Post subject: fonebook

records information to a file creating a fonebook
saves as friends. txt



friends.t
 Description:

Download
 Filename:  friends.t
 Filesize:  495 Bytes
 Downloaded:  109 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Mr. T




PostPosted: Mon Jun 05, 2006 7:09 pm   Post subject: Alex's Opinion

Mind changing your signature. Naughty
Clayton




PostPosted: Mon Jun 05, 2006 8:35 pm   Post subject: (No subject)

as stated above, plz change ur signature Sad plz read [The Rules] for a description of acceptable signatures, now on to ur program

first of all your first and last name inputs could cause you some trouble ex

Turing:

put "Please enter your first name"
get firstName


this will not cover inputs such as "Joe Bloe" "Suzie Sue" etc, if looking for string input its a good idea to do this

Turing:

put "Please enter first name"
get firstName:*


now about your exit condition

Turing:

exit when firstName="zzz"


this doesnt cover inputs like "zZz" or "ZZZ" etc, its a better idea to use a getch statement or use Str.Upper or Str.Lower to check for exit conditions

check the Turing Walkthrough to find new ways to improve this program and expand your programming skills Very Happy
_justin_




PostPosted: Tue Jun 06, 2006 11:31 am   Post subject: (No subject)

accutly for his exit statement the teacher told us to just use zzz as a exit Cool
wtd




PostPosted: Tue Jun 06, 2006 12:21 pm   Post subject: (No subject)

So if your teacher tells you to program poorly, you'll place complying with that more highly than getting a good education?

One of the most important things to remember when writing a program is that it must be robust. One component of this is that your program should work correctly, even with input that is slightly different than you were expecting.

User input can never be trusted to be perfectly formatted.

In this case, it's also very easy to make your program more robust. Simply make the entire input string lower-case, then check to see if it equals "zzz". This will catch "Zzz", "zZz", etc.
TheOneTrueGod




PostPosted: Tue Jun 06, 2006 2:34 pm   Post subject: (No subject)

Unfortunately, some teachers can be quite stubborn. For example, My grade 10/11 compsci teacher wouldn't let us use anything with a "." in it. That includes things like View.Set or Input.KeyDown... Or Str.Lower in this case. (I know you can just create your own Str.Lower function, but for something like Input.KeyDown, it could mean remaking the entire program...)

Still, you shouldn't post in-school assignments without polishing them up first. (Or anything really... Razz)
_justin_




PostPosted: Tue Jun 06, 2006 3:44 pm   Post subject: (No subject)

yea i see what you guys mean it is just that the teacher always says use "zzz" as the senital

but wtd you make a real good point here
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: