Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

For each of the below variable names, indicate (with y or n) whether it is legal and whether it uses the proper style. You may skip the style portion for any that are not legal. a. _isReady b. 3rdName c. num of wheels d. money#on#hand e. taxRate f. SeatNumber

OpenStudy (anonymous):

@hartnn I would greatly appreciate your help!

hartnn (hartnn):

variable names cannot start with a number or special character it should only start with an alphabet

OpenStudy (anonymous):

Ok so a. n b. n c. y d. y e. y f. y

hartnn (hartnn):

also there shouldn't be a space in between

hartnn (hartnn):

also # is not allowed in the name

OpenStudy (anonymous):

Oh. So a. n b. n c. n d. y, y e. y, y f. y, y

hartnn (hartnn):

actually _ in the beginning is allowed! so 1st one is valid

OpenStudy (anonymous):

Ok. But how do I know if they use the proper style?

hartnn (hartnn):

and last 2 are valid, all others are invalid :)

OpenStudy (anonymous):

How do I know if they use the proper style?

OpenStudy (anonymous):

They want to know if they are legal and if they use the proper style

hartnn (hartnn):

whats the proper style?

OpenStudy (anonymous):

I have no idea. Maybe with the case?

hartnn (hartnn):

i know about whether they are legal or not, i am not sure about styles.... try to dig it in your notes maybe?

OpenStudy (anonymous):

Ok thanks. It doesn't say anywhere. It only talks about proper identifier syntax

hartnn (hartnn):

http://www.c4learn.com/c-programming/c-variable-nameing-rules/ here they have explained in more clarity for the naming rules.. will search styles on internet

OpenStudy (anonymous):

Thanks!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!