40061: Given that the variables x and y have already been declared and assigned values, write an expression that evaluates to true if x is positive (including zero) and y is negative.
(x >= 0) And (y < 0)
40062: Given that the variables x and y have already been declared and assigned values, write an expression that evaluates to true if x is postivie (including zero) or y is negative.
(x >= 0) Or (y < 0)
40063: Given two variables, isEmpty of type boolean, indicating whether a class roster is empty or not, and numberOfCredits of type int, containing the number of credits for a class, write an expression that evaluates to true if the class roster is empty or the class is exactly three credits.
(numberOfCredits = 3) Or isEmpty
40356: Given the variables termperature and humidity, write an expression that evaluates to true if and only if the termperature is greater than 90 and the humidity is less than 10.
(temperature > 90) And (humidity < 10)
41111: Assume that c is a char variable that has been declared and already given a value. Write an expression whose value is true if and only if c is what is called a whitespace character (that is a space or a tab or a newline-- none of which result in ink being printed on paper).
(c = Chr(010)) Or (c = Chr(009)) Or (c = Chr(032))
40064: Given two variables, isEmpty of type boolean, indicating whether a class roster is empty or not, and numberOfCredits of type int, containing the number of credits for a class, write an expression that evaluates to true if the class roster is not empty and the class is more than 2 credits.
numberOfCredits > 2 And isEmpty = false
40065: Given two variables, isEmpty of type boolean, indicating whether a class roster is empty or not, and numberOfCredits of type integer, containing the number of credits for a class, write an expression that evaluates to true if the class roster is not empty and the class is one or three credits.
Not isEmpty And ((numberOfCredits= 1) Or (numberOfCredits = 3))
Question 40063 is incorrect. The amount of credits is exactly three so you should be using two equals signs instead of one.
ReplyDeleteSo the correct answer should be:
(numberOfCredits == 3) Or isEmpty
Visual Basic does not allow the double equals sign to perform evaluation. The original answer is correct. I tested it myself.
Delete