Libraries

A group of problems that help you to practice finding libraries, creating an object for the library, and calling actions within that library.

Select a Use Block

This program makes a math object and calls an action from the math library. However, it does not point to the math library it is using. Add the correct use statement to run this program.

Make a Math Object

This program uses the math library and an action from it. However, it does not define the math object before it calls the action. Add the correct definition of a math object with the right name to run this program.

Call an Action with the Object

This program uses the math library and creates a Math object. However, it does not call an action. Call a Math action that calculates 10 to the power of 3. Then run the program and check your answer.

Call Absolute Value

Build a program from the blocks in the tray that uses the math library, declares a math object, and calls the absolute value action. Edit the absolute value action so it finds the absolute value of -10.7 and outputs the following message.

The absolute value of -10.7 is 10.7

Calculating Floor and Ceiling

Build a program from the blocks in the tray that uses the math library, declares a math object, and calls the floor action and the ceiling action. Edit the floor and ceiling actions so they find the floor and ceiling of 41.4 and output the following messages.

The floor of 41.4 is 41.0
The ceiling of 41.4 is 42.0

Calculating Factorial

Build a program from the blocks in the tray that uses the math library, declares a math object, and calls the factorial action. Edit the actions so it finds the factorial of 4 and outputs the following message.

The factorial of 4 is 24.0

Raising to a Power

Build a program from the blocks in the tray that uses the math library, declares a math object, and calls the raise to the power action. Edit the action to find 3 to the power of 5 and output the following message.

3 to the power of 5 is 243

Rounding Numbers

Build the rest of this program by adding the needed blocks from the tray. This program should call two different round actions. The first will round 45.815173 to the nearest whole number. The second will round 45.815173 to the third decimal place. Finally, the program will output the rounded balues and should result in the following messages.

45.815173 rounded is 46.0
45.815173 rounded to the 3rd decimal place is 45.815

Solving a Math Problem

Imagine you have 5 different books and you want to arrange them on a bookshelf. How many ways could these 5 books be arranged on the shelf? Use one of the actions you have learned to answer to this question.