NTR 100 COMPLETE Syllabus and Academic Integrity Acknowledgement Arizona State University
NTR 100 COMPLETE Syllabus and Academic Integrity Acknowledgement Question 1 1 / 1 pts I have read the ASU ā¦
CIS115 WEEK 3 QUIZ
( CORRECT ANSWERS ARE IN BOLD LETTERS )
Question 1 2 / 2 pts
( TCO 4) In a decision structure, the _____ clause executes when the condition is true.
If
While
Else
Case
Instructor Explanation: See Chapter 4, Lecture.
Question 2
0 / 2 pts
(TCO 4) If an expression contains relational, logical, and arithmetic operators, which type of operator is evaluated last? Logical
Relational
Arithmetic
Depends on the expression
Instructor Explanation: See Chapter 4, Lecture.
Question 3
0 / 2 pts
(TCO 4) In order to have the most efficient program, which question should be asked first when using an || (or) decision?
There is no way to determine this.
The one that is less likely to be true.
The one with the lower values.
The one that is more likely to be true.
Instructor Explanation: See Chapter 4, Lecture.
Question 4
2 / 2 pts
(TCO 4) If a valid score is between 0 and 100, which Boolean expression is true if the value in the score variable is valid?
score > 0 || score < 100 score >= 0 || score <= 100 score >= 0 && score <= 100 score < 0 && score > 100
Instructor Explanation: See Chapter 4, Lecture.
Question 5
2 / 2 pts
( TCO 4) Evaluate each of the following conditions (as being true or false). Assume A
= 3, B = 6, C = 3, and D = 18.
C <= 3 AND D < A
True
False
Instructor Explanation:
C = 3, so 3 <= 3? is true. 18 < 3 is false. True AND false is false.
Question 6
2 / 2 pts
( TCO 4) Evaluate each of the following conditions (as being true or false). Assume A
= 3, B = 10, and Z = āfiveā.
A * 2 > B / 2 AND Z > ātwoā
True
False
Instructor Explanation:
Evaluates to 3 * 2 > 10 / 2 AND āfiveā < ātwoā. 6 > 5 AND āfiveā > ātwoā. 6 > 5 is true. āfiveā > ātwoā is false because āfiveā comes alphabetically after ātwoā. So true AND false = false.
Question 7 2 / 2 pts
( TCOs 3 and 4) Given the following If structure, assume B = 100. Which will be the output?
B
Missed It!
You got an A
100
Instructor Explanation:
B = 100, so (100 >= 90 AND 100 <= 100) evaluates to (true AND true) = true, so āYou got an Aā is output.
Question 8 2 / 2 pts
( TCOs 3 and 8) Which will be displayed after the following process is completed?
Start
Set x = 3
Set y = 2
Set z = 3
If ((x = 1) OR (y = 1) OR (z = 1)) then
Set ans = āTrueā
Else
Set ans = āFalseā
End if
Display ans
Stop
True
False
Instructor Explanation:
( x = 1) OR (y = 1) OR (z = 1) evaluates to (3 = 1) OR (2 = 1) or (3 = 1), which evaluates to (false) or (false) or
( false) = false, because in an Or expression one of the conditions must be true, so āFalseā is displayed.
Question 9
2 / 2 pts
( TCO 8) Which will be displayed after the following process is completed?
Start
Set w = 0
Set x = 1
Set y = 2
Set z = 3
If ((w \<> 0 OR x = 1) AND (y = 2 OR z \<> 3)) then
Set ans = āTā
Else
Set ans = āFā
End if
Display ans
Stop
True
False
Instructor Explanation:
(w <> 0 OR x = 1) AND (y = 2 OR z <> 3) evaluates to (0 <> 0 OR 1 = 1) AND (2 = 2 OR 3 <> 3), evaluates to
( false OR true) AND (true OR false) = (true) AND (true) = true, because in And expressions, all the conditions must be true. Thus, āTā is displayed.
Question 10 0 / 2 pts
( TCO 8) Which will be displayed after the following process is completed?
Start
Set grade = āCā
If (grade \<> āAā AND grade \<> āBā AND grade \<> āCā
AND grade \<> āDā AND grade \<> āFā) then
Set message = "invalid grade"
Else
Set message = "valid gradeā
End if
Display message Stop
invalid grade valid grade
Instructor Explanation:
grade <> āAā AND grade <> āBā AND grade <> āCā AND grade <> āDā AND grade <> āFā evaluates to āCā <> āAā AND āCā <> āBā AND āCā <> āCā AND āCā <> āDā AND āCā <> āFā evaluates to true AND true AND false AND true AND true = false, so “valid grade” will be displayed.
NTR 100 COMPLETE Syllabus and Academic Integrity Acknowledgement Question 1 1 / 1 pts I have read the ASU ā¦
HEP 456 Module 5 Section 12 and 13 Planning for Analysis and Interpretation and Gantt chartĀ Name HEP 456: ā¦
HEP 456 Module 6 Section 14 Communication and Dissemination of The Findings HEP 456: Health Promotion Program ā¦