How can I make a program that solves the area of a triangle. I know how to prompt the user, but I just don't know how to implement the equation into a program.
humanwormbaby wrote:
How can I make a program that solves the area of a triangle. I know how to prompt the user, but I just don't know how to implement the equation into a program.
The equation to find the area of a triangle is (1/2)*Base*Height
You could create 3 variables - one where you prompt for the base, another for the height, and the last one to store the answer to.
Example:
Code:
0->C
0->A
0->B
Disp "Height?
Prompt A
Disp "Base?
Prompt B
(.5*A*B)->C
Disp "Area:
Disp C
Stop
A=Height
B=Base
C=Area
Get it?
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement