Showing posts with label area of a circle in perl. Show all posts
Showing posts with label area of a circle in perl. Show all posts

Friday, April 27, 2018

Diameter, Circumference and Area of a Circle in PERL

A very simple program to ask the user to give a value in radius and then our program will compute the diameter, circumference and area of a circle using PERL as our programming language.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.


My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.




Sample Program Output


Program Listing

circle.pl


use Math::Round;

print "\n\n";
print "Diameter, Circumference and Area of a Circle in PERL";
print "\n\n";
print "Created By Mr. Jake R. Pomperada,MAED-IT";
print "\n\n";
print "What is the radius? : ";
$r = <>;
$diameter = (2 * $r);
$area = (3.1416 * ($r ** 2));
$circum = ($diameter * 3.14);

my $diameter2 = nearest(.1,$diameter); 
my $area2 = nearest(.1,$area);
my $circum2 = nearest(.1,$circum);

print "\n\n";
print "===== DISPLAY RESULT =====";
print "\n\n";
print "The diameter of the circle is $diameter2.";
print "\n\n";
print "The area of the circle is $area2. ";
print "\n\n";
print "The Circumference of the circle is $circum2.";
print "\n\n";
print "End of Program";
print "\n\n";