ascendantofrain
Solid State Member
- Messages
- 10
Hey guys, I am already going to be asking for a little help....I believe i have an okay idea of what I am doing but I would just like to make sure I am doing things right and if I am not, I would hope to hear constructive criticism.
Here's the problem:
If myAge and yourRate are numeric variables, and departmentCode is a character variable, which of the following statements are valid assignments? If a statement is not valid, explain why not.
a. myAge = 23 is a valid assignment
b. myAge = yourRate is a valid assignment
c. myAge = departmentCode is not a valid assignment because departmentCode is a character variable and character variables need quotes.
d. myAge = “departmentCode†is a valid assignment.
e. 42 = myAge is not a valid assignment because assignments must begin with alphabetic characters.
f. yourRate = 3.5 is a valid assignment.
g. yourRate = myAge is a valid assignment.
h. yourRate = deaprtmentCode is not a valid assignment because both values would have to be character values for it to be true or departmentCode must have quotes.
i. 6.91 = yourRate is not a valid assignment because assignments must begin with alphabetic characters.
j. departmentCode = Personnel is not a valid assignment because values for a character variable must be in quotes.
k. departmentCode = “Personnel†is a valid assignment.
l. departmentCode = 413 is not a valid assignment because character variables must equal a constant in quotes.
m. departmentCode = “413†is a valid assignment.
n. departmentCode = myAge is a valid assignment.
o. departmentCode = yourRate is a valid assignment
p. 413 = departmentCode is not a valid assignment because assignments must begin with alphabetic characters.
q. “413†= departmentCode is not a valid assignment because a assignments must begin with alphabetic characters.
Obviously my answers are written after the "assignment"....thanks for your help guys!!!
Here's the problem:
If myAge and yourRate are numeric variables, and departmentCode is a character variable, which of the following statements are valid assignments? If a statement is not valid, explain why not.
a. myAge = 23 is a valid assignment
b. myAge = yourRate is a valid assignment
c. myAge = departmentCode is not a valid assignment because departmentCode is a character variable and character variables need quotes.
d. myAge = “departmentCode†is a valid assignment.
e. 42 = myAge is not a valid assignment because assignments must begin with alphabetic characters.
f. yourRate = 3.5 is a valid assignment.
g. yourRate = myAge is a valid assignment.
h. yourRate = deaprtmentCode is not a valid assignment because both values would have to be character values for it to be true or departmentCode must have quotes.
i. 6.91 = yourRate is not a valid assignment because assignments must begin with alphabetic characters.
j. departmentCode = Personnel is not a valid assignment because values for a character variable must be in quotes.
k. departmentCode = “Personnel†is a valid assignment.
l. departmentCode = 413 is not a valid assignment because character variables must equal a constant in quotes.
m. departmentCode = “413†is a valid assignment.
n. departmentCode = myAge is a valid assignment.
o. departmentCode = yourRate is a valid assignment
p. 413 = departmentCode is not a valid assignment because assignments must begin with alphabetic characters.
q. “413†= departmentCode is not a valid assignment because a assignments must begin with alphabetic characters.
Obviously my answers are written after the "assignment"....thanks for your help guys!!!