Program for Exercise 3.1

 

The program depends on the technology you use.  Here is one that works on the TI-83 Plus graphing calculator.

 

 

Select PRGM to get the program menu.  Then select NEW to create a new program.  You must first give a program name. 

Comments, which should not be entered into the calculator, are set off by the symbol %.

 

 

NAME = LAB2

: 0 STOà C                          % ‘STOà’ is right above the ‘ON’ button. %

: 0 STOà I

: For(I,1,100,1)                      % ‘For(’   is accessed via PRGM, CTL when you are writing or editing a program. %

:Rand STOà X                    % ‘Rand’ is accessed under MATH, PRB%

:Rand STOà Y

:If(X^2 + Y^2) < 1                % ‘If’ is accessed under PRGM, CTL when you are writing or editing a program. %

C+1 STOà C

: End                                      % ‘End’  is accessed via PRGM, CTL when you are writing or editing a program. %

: Disp 4*C/100                      % Disp  is accessed via PRGM, I/O when you are writing or editing a program. %

 

 

To run the program hit PRGM, select LAB2, and hit ENTER.  After a few moments an estimated of pi will appear based on 100 Monte Carlo trials.

 

If you want to make changes to your program, select PRGM, move to EDIT, and then select the number of the program you want to edit.