Re: Homework Help #1
mostly correct, however,m some of the answers/reasons are wrong...
c. myAge = departmentCode is not a valid assignment because departmentCode is a character variable and character variables need quotes.
myAge = departmentCode is not valid because myage is numeric and department code is char, mismatched datatype.
d. myAge = “departmentCode” is a valid assignment.
myAge = "departmentCode" is not valid because "departmentCode" (with quotes) is a string, myAge datatype is numeric
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.
yourRate = departmentCode is not valid since yourate is numberic and departmentcode is char
j. departmentCode = Personnel is not a valid assignment because values for a character variable must be in quotes.
departmentCode = personnel is not valid because personnel is not a variable thus the string must appear in quotes to be assigned to the variable.
l. departmentCode = 413 is not a valid assignment because character variables must equal a constant in quotes.
depaerment code = 413 is valid (yet problematic), the ASCII char represented by the code 413 will be stored in the department code variable
n. departmentCode = myAge is a valid assignment.
departmentcode = myage is valid, however, this will not give expected results, since the department code data type is char and the myAge is numric, in this instance the ASCII code represented by the age variable would be stored in the departmentcode variable, (e.g myAge=12 department code=carrige return).
o. departmentCode = yourRate is a valid assignment
p. 413 = departmentCode is not a valid assignment because assignments must begin with alphabetic characters.
413 = department code is invalid since 413 is not a variable, or, variablename name must come before data during assignment.
q. “413” = departmentCode is not a valid assignment because a assignments must begin with alphabetic characters.
"413" = depaermentCode is not valid because variablename must come before assigned value, (bad syntax)
I guess I just hope that you understand what I am on about!!!, if you don't then don't worry it will come to you after you've done a few assignments...
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."