visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: Pascal :: Programming Languages


By: collegeBoy U.S.A.  Date: 19/01/2003 00:00:00  English  Points: 50 Status: Answered
Quality : Excellent
how do we create a Pascal Program for the Area of the Circle
By: monange Date: 19/01/2003 11:08:00 English  Type : Answer
Sounds a lot like homework.

What is the formula for the area of a circle

Try something like this

Create a new program
Ask the user for the radius or the diameter
Calculate the area of the circle
Display the area of the circle
End the program

mlmcc
By: TheFalklands Date: 21/01/2003 20:39:00 English  Type : Comment
try this one if it helps:

area:=3.14159*radius*radius;

does it solves the problem?
By: VGR Date: 24/01/2003 09:38:00 English  Type : Assist
sure it'll solve it. (even if you limited the number of decimals of Pi :D :D )

Why don't people just read the compiler's manual (or the language's manuel, like the "Pascal Report" of Wirth), or "Data+Algorithm=Program", and think two minutes and a half of the way they compute "manually" (mentally) the area of the circle, then implement it simply and concisely ?

I'll never understand this.

Always asking someone else first, in stead of working, I'll never understand.

demo for saxcool :

1) the area of the circle if equal to Pi*square of the radius, usually (as of 1881 :D even for Americans :D :D ) in meters for the radius.

2) so we need to have the radius value, input by the user, and print out (output) the value of the computation of the area of the circle having that radius.

3) cool. Take a break. You worked hard. Now you have your algorithm and your interface (input/output)

4) now program and run it !

Program CircleArea(Input,Output);
Const monPi : Extended = 3.141592653589793238462 ;
Var radius, area : Extended;
Begin
WriteLn('Welcome in The Area Calculator of Saxcool');
Write('Please enter the radius of the circle in m : ');
ReadLn(radius);
area:=monPi*radius*radius; // thanks gikam for the formula 8-)
WriteLn('The area value is ',area:16:4,' m²');
WriteLn('done. Saxcool thanks you.');
End. { CircleArea Program }

Do register to be able to answer

EContact
browser fav
page generated in 302.747010 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page