Getting Started Activity:

Programming the Formula to find the Volume of a Cylinder given Radius and Height

Given the Radius and Height of a cylinder, you can compute the Volume using this formula. This activity allows you to write a program to prompt for the values of the Radius and Height of a cylinder so that you can then compute the Volume.

The formula for the volume of a cylinder is

V = p R2 H cubic units

Where

V = Volume

R = Radius of the base

H = Height of the cylinder

This program could be useful for a variety of activities such as:

Providing a table with many values of Radius and Height and having students fill out the Volume column
Running a program to fill in the values for Volume in the table

Some questions to investigate:

(If formula is unknown to the student), what pattern do you see in the Volume numbers to make a good guess at the formula?
What is the largest Volume found?
How much does the Volume increase if the Height increases by one unit?
How much does the Volume increase if the Radius increases by one unit?

Running a program repeatedly as a tool allows quick analysis for higher-level thinking problems.

Topic Links

Creating a NEW Program

1. Press ¼ ~ ~ to display the PRGM NEW menu.

Naming the Program

 

1. Press Í to select 1:Create New.

The Name= prompt is displayed, and [2nd] [A-lock] (alpha-lock) is on.

Tip: The alpha characters are upper right above keys on the keypad and are pasted when [alpha] or
[2nd] [A-lock] is pressed before pressing the primary key.

2. Press C Y L I N D E R, and then press Í to name the program CYLINDER.

Tip: Program names can have a maximum of eight characters. First character must be a letter. Notice the checkerboard cursor on the screen when the maximum is reached.

3. Press Í and you are now in the program editor.

The colon ( : ) in the first column of the second line indicates the beginning of a command line.

Note: On the calculator, the command lines are not numbered as when using the
TI Connect™ CE Program Editor.

Entering Commands

Whoever uses your program will have to input the Radius and Height values. You will use the Prompt command.

 

1. Press ¼ ~ to access the I/O (Input/Output) command menu.
2. Press to highlight the Prompt command.

Note: For this example, you will use the Catalog Help feature to illustrate this built-in argument syntax help in the calculator. If you already know the arguments for a command, you can select a menu item and paste them to the Program Editor without using Catalog Help.

3. The Prompt menu item number is highlighted so press Ã. Use the Catalog Help syntax editor (if needed). The syntax for the arguments of Prompt is shown below the editing line as variables separated by commas. Anything within a square bracket [ ] is an optional argument, so Prompt needs at least one variable name.
4. Press ƒ R ¢ ƒ H to enter the variable names for Radius and Height.
5. Press [PASTE] (r) to paste the command with the arguments back to the Program Editor. Press [ESC] ([graph]) to return to the last cursor location without pasting.

6. Back on the Program Editor, press Í to move the cursor to the next command line.

Store the formula for the volume of a cylinder:

7. To enter the expression B R2 H and store value to the variable V, press y B ƒ R ¡ ƒ H ¿ ƒ V Í.

Displaying the Calculated Volume.

Create a command line to display the calculated volume:

 

1. Press ¼ ~ 3 to select 3:Disp from the PRGM I/O menu.

Disp is pasted to the command line.

Tip: Remember you can press [+] on most commands to use the Catalog Help syntax editor to see the correct arguments for commands.

2. Press y 7 W VOLUME IS W ƒ ¢ ƒ V Í

This will display the text VOLUME IS on one line and the calculated value of V on the next line of the Home Screen when you run the program.

Running a Program

Your program is complete! Now run the program from the Home Screen.

 

1. Press y 5 to display the Home Screen.
2. Press ¼ to display the PRGM EXEC menu.

The items on this menu are the names of stored programs.

3. Press Í to paste prgm CYLINDER to the current cursor location. (If CYLINDER is not item 1 on your PRGM EXEC menu, move the cursor to CYLINDER before you press Í.)

Finding the Volume

To find the volume of the cylinder with Radius 1.5 cm and Height 3 cm, complete the following steps.

 

1. Press Í to execute (run) the program.
2. When prompted for R, enter 1.5 and press Í
3. When prompted for H, enter 3 and press Í.

The text VOLUME IS, the value of V, and Done are displayed.

The volume of the cylinder is displayed to 8 decimal places as
21. 20575041 cubic cm.

4. At this point, to rerun the program, press Í and repeat for different values of R and H.