0% found this document useful (0 votes)
12K views

Programming With Mathcad Prime 5

The document describes how to create a Mathcad program that calculates the area of a circle given its diameter as an input parameter. It is a multi-step process that involves naming the program "A", defining it to accept a diameter parameter "D", using a local assignment operator to define the radius as D/2, and then inserting the formula for calculating the area of a circle using the defined radius.

Uploaded by

Jay Cee
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12K views

Programming With Mathcad Prime 5

The document describes how to create a Mathcad program that calculates the area of a circle given its diameter as an input parameter. It is a multi-step process that involves naming the program "A", defining it to accept a diameter parameter "D", using a local assignment operator to define the radius as D/2, and then inserting the formula for calculating the area of a circle using the defined radius.

Uploaded by

Jay Cee
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Local Definition

In the image at right the formula for circumference of a


circle is defined in a Mathcad Program using Mathcad

Prime’s Local Definition operator . In this case


the use of the Local Definition helps to clarify the
meaning of the program named C. C accepts a single
parameter, the measurement of a diameter of the circle.
During program execution Circumference is calculated
using the formula π*D. C returns the value of
Circumference, the last value calculated. But, since it is
defined locally, the value of Circumference is undefined
outside of the program definition. Therefore,
Circumference is undefined on the worksheet and
returns an error when evaluated.

Follow these steps to create a Mathcad program that calculates the area of a circle given its
Diameter as an input parameter:

Step 1: Type the following keystrokes to give the program a name and a parameter:

A(D: You should see this on the worksheet:

Step 2: Mathcad shows that it is waiting for the program to be defined on the right side of the assignment
statement by leaving the blue cursor in the placeholder. Follow these steps to insert the first line of the
program:

Left-click to select the Math ribbon

Left-click on the Programming icon

Left-click the Insert Program Structure


icon on the Programming menu

Type: radius in the placeholder

Left-click on the Programming icon on the Math ribbon

Left-click on the Local Assignment Operator icon on the


Programming menu

Type: D/2 in the placeholder. Hit the Right Arrow key once to
advance the cursor and then hit the ENTER key. A new Program
line will appear as shown.

Programming with Mathcad Prime | pg. 3

You might also like