7.5: Exercises
- Page ID
- 54271
\( \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}}\)
Below are some quiz questions and project suggestions based on this chapter.
Quiz Questions
Below are some quiz questions.
- What are the four program development steps?
- What are the three types of errors?
- If a program to compute the area of a rectangle uses a formula, \(\textit{height} \times \textit{height} \times \textit{width}\), what type of error would this be?
- Provide an example of that would generate a compiler error.
Suggested Projects
Below are some suggested projects.
- Type in the pendulum period calculation program, compile, and execute the program. Test the program using several different input values.
- Create a program to prompt for and read the circle area from the user and calculate the circumference of a circle using the following formula:
\[ \textit{circumference} = 2 \sqrt{\pi \cdot \textit{CircleArea}} \nonumber \]Test the program using several different input values. - Create a program to prompt for and read the radius of a sphere from the user and calculate the surface area of the sphere using the following formula:
\[ \textit{sphere Surface Area} = 4 \pi r^2 \nonumber \]Test the program using several different input values. - Create a program to prompt for and read the radius of a sphere from the user and calculate the sphere volume using the following formula:
\[ \textit{sphere Volume} = (4 \pi / 3) r^3 \nonumber \]Test the program using several different input values.