26.5: Quiz Question Answers - Chapter 5
- Page ID
- 54414
\( \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 5 are as follows:
- The assignment operator is
=
(equal sign). - The exponentiation operator is
**
(double asterisks, no space). - An integer variable can be converted to a real with the real conversion function. For example,
realVar = real(intVar)
- An integer variable can be converted to a real with the real conversion function. For example,
intVar = int(realVar)
Note, in this example precision may be lost since the fractional part is truncated (not rounded). - The two logical constants are
.true.
and.false.
which must include the leading and trailing periods. - Some intrinsic functions are
real()
,int()
,nint()
,cos()
,sin()
,mod()
,tan()
, andsqrt()
. There are more as listed in Appendix D. - The statements are as follows:
x1 = (pi / 6.0) * (3.0 * a**2 + 3.0 * b**2 + c**2) x2 = -(2.0 * a / c) * cos(b) * sin(b) x3 = (-b + sqrt(b**2 – 4.0 * a * c)) / (2.0 * a)