#!/usr/bin/perl -w use strict; my ( $area, $peri, $side, $radi, $leng, $widt, $base, $heig, $base1, $base2 ); print "Welcome to Formula Calculator Version 1.0!\n"; print "What formula do you wish to calculate: area, perimeter, or volume? "; my $form = ; chomp $form; if ( $form eq "area" or "Area" ) { print "What shape do you wish to find the area for: square, circle, rectangle,\n", "parallelogram, triangle, or trapezoid? "; my $shape = ; chomp $shape; if ( $shape eq "square" or "Square" ) { print "What is the length of one of the sides? "; $side = ; chomp $side; $area = $side ** 2; print "The area of the square is equal to ", $area, "."; } elsif ( $shape eq "circle" or "Circle" ) { print "What is the radius? "; $radi = ; chomp $radi; $area = 3.14 * $radi ** 2; print "The area of the circle is ", $radi, "."; } elsif ( $shape eq "rectangle" or "Rectangle" ) { print "What is the length? "; $leng = ; chomp $leng; print "What is the width? "; $widt = ; chomp $widt; $area = $leng * $widt; print "The area of the rectangle is equal to ", $area, "."; } elsif ( $shape eq "parallelogram" or "Parallelogram" ) { print "What is the base? "; $base = ; chomp $base; print "What is the height? "; $heig = ; chomp $heig; $area = $base * $heig; print "The area of the parallelogram is equal to ", $area, "."; } elsif ( $shape eq "triangle" or "Triangle" ) { print "What is the base? "; $base = ; chomp $base; print "What is the height? "; $heig = ; chomp $heig; $area = 0.5 * ( $base * $heig ); print "The area of the triangle is equal to ", $area, "."; } elsif ( $shape eq "trapezoid" or "Trapezoid" ) { print "What is the measurement of one of the bases? "; $base1 = ; chomp $base1; print "What is the measurement of the other base? "; $base2 = ; chomp $base2; print "What is the height? "; my $heig = ; chomp $heig; $area = 0.5 * $heig * ( $base1 + $base2 ); print "The area of teh trapezoid is equal to ", $area, "."; } else { print "That was not a given choice."; } } elsif ( $form eq "perimeter" or "Perimeter" ) { print "What is the length? "; my $leng = ; chomp $leng; print "What is the width? "; my $widt = ; chomp $widt; my $peri = ( $leng * 2 ) + ( $widt * 2 ); print "The perimeter is equal to ", $peri, "."; } elsif ( $form eq "volume" or "Volume" ) { } else { print "That was not a given choice."; }