Activecode Exercises¶
Answer the following Activecode questions to assess what you have learned in this chapter.
Finish the code below so that it prints “I drive a 2014 Buick Regal”. Select the Parsonsprob tab for hints for the construction of the code.
Finish the code below so that it prints “I drive a 2014 Buick Regal”. Use the lines to construct the code, then go back to complete the Activecode tab.
Finish the code below so that it returns the correct volume of a sphere. Select the Parsonsprob tab for hints for the construction of the code. Hint: think about what happens when you use integer division. The volume of a sphere is given by V = (4/3)(pi)(r^3).
Finish the code below so that it returns the correct volume of a sphere. Use the lines to construct the code, then go back to complete the Activecode tab. The volume of a sphere is given by V = (4/3)(pi)(r^3).
Write code that assigns “apples” to the variable oranges, and “oranges” to the variable apples, then swaps their values. Be sure to inclue any necessary headers. YOU MAY NOT HARDCODE YOUR SOLUTION. Select the Parsonsprob tab for hints for the construction of the code.
Write code that assigns “apples” to the variable oranges, and “oranges” to the variable apples, then swaps their values. Be sure to inclue any necessary headers. Use the lines to construct the code, then go back to complete the Activecode tab.
Write code that calculates how much you you will spend after tipping 20% on your $36.25 dinner. Save the result of this calculation in plusTip
. Be sure to include any necessary headers. Select the Parsonsprob tab for hints for the construction of the code.
Write code that calculates how much you you will spend after tipping 20% on your $36.25 dinner. Save the result of this calculation in plusTip
. Use the lines on to construct the code, then go back to complete the Activecode tab.
Write code that calculates and prints the average of a and b if a = 3.14, and b = 1.59. You may only use one line of code. Be sure to inclue any necessary headers. Select the Parsonsprob tab for hints for the construction of the code.
Write code that calculates and prints the average of a and b if a = 3.14, and b = 1.59. You may only use one line of code. Use the lines on to construct the code, then go back to complete the Activecode tab.