Try these practice questions with multiple choice answers. There are five questions in total.
Arrange the code blocks to create a program that calculates the sale price of an item after a 25% discount.
Arrange the code blocks to create a program that calculates the sum from 0 to a chosen number.
Arrange the code blocks to create a program that calculates the volume of cylinder and cone.
Arrange the code blocks to create a program that calculates the compound interest. Use the hints given inside the code to help you!
Arrange the code blocks to create an exponent calculator.
Create a program that asks the user to enter the cost of an item. Determine the 13% tax on the item and the total cost. Use 3 variables to store the information needed in this program.
Option 1: Use this program that has already been started. Reassemble the blocks to complete the program.
Option 2: Create the program completely on your own.
Potential Extensions
1 – Have the program ask how much money is being used to pay for the item and tell the user how much change they should receive.
2 – Ask the user to enter a percentage discount on the item. Determine the adjusted price, tax and total cost.
This program has already been started for you. It asks the user to enter an item and a cost for that item which will be stored in two lists.
If the user enters “STOP” the program should stop asking for more entries.
Unfortunately, all the blocks inside the loop have been set aside in a random order.
Your task is to reassemble those blocks of code.
Potential Extensions
1 – Determine the total number of items that have been entered and indicate this total to the user.
2 – Determine the total cost of all the items. Add a new line in the lists that indicates the total cost.
3 – Add a third list that keeps track of the running total of the items.
Create a program that asks the user to enter a 3-digit number.
Determine at least 2 of the following characteristics about the number entered and output suitable statements.
a) Is the number greater than or less than 500?
b) Is the number odd or even?
c) Is the number a multiple of 10?
d) Is the number divisible by 3 or 7 or both 3 and 7?
e) Is the number a perfect square?
f) Is the number a palindrome?
Here is a sample program showing how decision structures work: Example of using Decision Structures
This program challenges you to accurately create a particular angle inside a circle.
Add on to the end of the program to provide feedback on the accuracy of the angle that was created.
Option 1: Indicate to the user if the angle they created was too large, too small or exactly right.
Option 2: Give the user different word descriptions depending on how close they are to the correct angle.
Example: if the angle was within 2 – “Wow that was very close”, if within 5 – “Pretty close!” etc.
Potential Extensions
1 – Once the angle has reached 360, have the circle clear and reset the angle back to 0.
2 – Generate target angles between -360 and +360. For negative angles, the angle should rotate clockwise.
Here is a sample program that uses a repeat to create a list.
Create a program that uses a loop to count up by 2’s, starting at 0. Display the numbers in a list.
Create the program that uses a loop to find the Fibonacci numbers. Display the results in a list.
Ask the user for a slope and y-intercept of a line. Generate a set of points on the line. Display the points.