26.8: Quiz Question Answers - Chapter 8
- Page ID
- 54417
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)
Quiz question answers for chapter 8 are as follows:
- The six relational operators are >, >=, <, <=, ==, and /=.
- The three basic logical operators are
.and.
,.or.
, and.not.
where the leading and trailing periods are required. - The answers are
.true.
,.true.
,.false.
,.true.
,.true.
,.false.
, and.false.
where the leading and trailing periods are required. - The statements are as follows:
if (lives <= 0) then write (*,*) "Game Over" end if
Note, this also could be done as follows:if (lives <= 0) write (*,*) "Game Over"
- The statements are as follows:
if (num < 0) then num = abs(num) write (*,*) "Variable num was made positive" end if
- The statements are as follows:
if (y /= 0) then z = x / y else z = 0 write (*,*) "Z not calculated" end if
Note, another correct solution is as follows:if (y == 0) then z = 0 write (*,*) "Z not calculated" else z = x / y end if
- The statements are as follows:
if (x <= 0.0) then f = x**2 * y else f = x * y end if