Activecode Exercises¶
Answer the following Activecode questions to assess what you have learned in this chapter.
Fix the code below so that it prints “2 elephants”. Select the Parsonsprob tab for hints for the construction of the code.
Fix the code below so that it prints “2 elephants”. Use the lines to construct the code, then go back to complete the Activecode tab.
Finish the code below so that it calculates the common log of a
minus the natural log of a
and prints the difference. You will need to use cmath functions.
Select the Parsonsprob tab for hints for the construction of the code.
Finish the code below so that it calculates the common log of a
minus the natural log of a
and prints the difference. You will need to use cmath functions. Use the lines to construct the code, then go back to complete the Activecode tab.
Write a function called intDivision
that takes two doubles as parameters and prints the quotient of the integer division of the first number divided by the second. Be sure to include any necessary headers.
Select the Parsonsprob tab for hints for the construction of the code.
Write a function called intDivision
that takes two doubles as parameters and prints the quotient of the integer division of the first number divided by the second.
Use the lines to construct the code, then go back to complete the Activecode tab.
Write a function called volumePrism
that takes three double
sidelengths as parameters, and calculates and prints the volume of a the rectangular prism. Be sure to include any necessary headers.
Select the Parsonsprob tab for hints for the construction of the code.
Write a function called volumePrism
that takes three double
sidelengths as parameters, and calculates and prints the volume of a the rectangular prism.
Use the lines to construct the code, then go back to complete the Activecode tab.
Write a function called volumeSphere
that takes a double
radius as a parameter, and calculates and prints the volume of a sphere with that radius. Use 3.14 for pi
. Be sure to include any necessary headers.
Select the Parsonsprob tab for hints for the construction of the code.
Write a function called volumeSphere
that takes a double
radius as a parameter, and calculates and prints the volume of a sphere with that radius. Use 3.14 for pi
.
Use the lines to construct the code, then go back to complete the Activecode tab.