Skip to main content
Engineering LibreTexts

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.

    1. What are the four program development steps?
    2. What are the three types of errors?
    3. 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?
    4. Provide an example of that would generate a compiler error.

    Suggested Projects

    Below are some suggested projects.

    1. Type in the pendulum period calculation program, compile, and execute the program. Test the program using several different input values.

    2. 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.

    3. 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.

    4. 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.


    This page titled 7.5: Exercises is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Ed Jorgensen via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?