Friday, September 10, 2010 08:53:40Login · Register
 

    Challenge Activity
07:42:10 - l0gan_l135
     - Completed real [3]
05:55:17 - aspen_23
     - Completed recon [1]
02:27:21 - GemaRastem
     - Completed basic [2]
02:26:21 - GemaRastem
     - Completed basic [1]
02:21:00 - GemaRastem
     - Completed recon [3]
01:55:39 - GemaRastem
     - Completed recon [2]
01:43:45 - GemaRastem
     - Completed recon [1]
01:31:59 - veerendragautam2009
     - Completed decrypt [3]
01:26:45 - veerendragautam2009
     - Completed decrypt [2]
01:25:16 - veerendragautam2009
     - Completed decrypt [1]
12:31:00 - veerendragautam2009
     - Completed basic [1]
12:26:04 - veerendragautam2009
     - Completed recon [6]
11:13:29 - veerendragautam2009
     - Completed recon [3]
10:59:23 - veerendragautam2009
     - Completed recon [1]
09:30:05 - sirEgghead
     - Completed real [4]
06:43:31 - tyllerdurdent
     - Completed recon [3]
 

    Scoreboard Top 20
UserPoints
Abhineet4795   
auditorsec4795   
ne0114795   
Null Set4795   
blandyuk4780   
bluechill4750   
Teddy4730   
TurboBorland4475   
Qwexotic4460   
tiiger11114205   
preet4180   
LiquidFusi0n4175   
OnlyHuman4125   
samthg4110   
satishek3900   
pilchdragon3660   
Override3655   
chronic123640   
sirEgghead3625   
dash803590   
 

    Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
 

    Users Online
· Guests Online: 5

· Members Online: 4
hydy07, paulinamc, l0gan_l135, elostaz3omda

· Members on IRC: 9
Xires, TurboBorland, ryan1918, Polynomial, louve, LK, IFailStuff, epoch_qwert, connection

· Bots Online: 1
GoogleBot

· Total Members: 1,491
· Newest Member: elostaz3omda
 

 

 

 

    Top 10 Forum Posters
UserPosts
bluechill918   
Qwexotic699   
cruizrisner487   
Null Set363   
TurboBorland335   
madf0x311   
Stormc1nd3r308   
auditorsec302   
Override238   
jakecrepinsek235   
 

    Affiliates
 

Perl Geometry Program
file.pl

Download source  GeSHi: Perl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
print "Input 1 for circles, 2 for squares, 3 for rectangles, 4 for cubes and 5 for cylinders, and anything else for triangles.n";
my $input = <STDIN>;
chomp($input);
if ($input == 1) {
print "Input the radius of a circle to receive both the area and the circumference.n";
my $circle = <STDIN>;
chomp($input);
my $pi2 = 3.141592653589793238462643383279502 * 2 * $circle;
my $var2 = 3.141592653589793238462643383279502 * $circle **2;
print "The area is $var2, the circumference is $pi2.";
}
elsif ($input == 2) {
print "Input the length of a side of the squaren";
my $square = <STDIN>;
chomp($square);
my $sqvar = $square **2;
my $sqcvar = $square *4;
print "The area is $sqvar and the perimeter is $sqcvar.n";
}
elsif ($input == 3) {
print "Input the length of the rectanglen";
my $reclen = <STDIN>;
chomp($reclen);
print "Now input the widthn";
my $recwid = <STDIN>;
chomp($recwid);
my $recarea = $reclen * $recwid;
my $recper = ($reclen * 2) + ($recwid * 2);
print "The area of the rectangle is $recarea, the perimeter is $recper.n";
}
elsif ($input == 4) {
print "Input the length of one edge of the cube.n";
my $cubelen == <STDIN>;
chomp($cubelen);
my $cubevol = $cubelen **3;
my $cubearea = $cublen **2 * 6;
print "The volume of the cube is $cubevol and the surface area is $cubearea.n";
}
elsif ($input == 5) {
print "Input the radius of the cylinder.n";
my $cylrad = <STDIN>;
chomp($cylrad);
print "And the height.n";
my $cylh = <STDIN>;
chomp($cylh);
my $cylvol = 3.141592653589793238462643383279502 * ($cylrad **2) * $cylh;
my $notop = 2 * 3.141592653589793238462643383279502 * $cylrad * $cylh;
my $top = 2 * 3.141592653589793238462643383279502 * ($cylrad **2) + 2 * 3.141592653589793238462643383279502 * ($cylrad * $cylh);
print "The volume is $cylvol, the area without the top and bottom is $notop, and the area WITH the top and bottom is $topn";
}
else {
print "What's the base of the triangle?n";
my $tribase = <STDIN>;
chomp($tribase);
print "What's the height?n";
my $triheight = <STDIN>;
chomp($triheight);
print "What's the length of one side of the triangle?n";
my $length1 = <STDIN>;
chomp($length1);
print "What about the second side?n";
my $length2 = <STDIN>;
chomp($length2);
print "And the third side?n";
my $length3 = <STDIN>;
chomp($length3);
my $triarea = $triheight * $tribase / 2;
my $triper = $length1 + $length2 + $length3;
print "The area of the triangle is $triarea and the perimeter is $tripern";
}
Parsed in 0.027 seconds, using GeSHi 1.0.8.6
Comments
 
No Comments have been Posted.
 
 
Post Comment
 
Please Login to Post a Comment.
 
 
Ratings
 
Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.