Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!C:\Strawberry\perl\bin
- use warnings;
- my $stop = 0;
- until ($stop != 0) {
- print "this program will compute the circumfrence of a circle.\n";
- print "\n";
- print "Please enter in the radius of your circle.\n";
- $radius = <STDIN>;
- until ($radius ne "\n") {
- print "please enter a number ";
- $radius = <STDIN>;
- }
- print "The radius of your circle is ";
- print 2 * 3.141592654 * $radius;
- print "\n";
- print "do you want to calculate another?(yes/no)\n";
- $stop = 0;
- $answer = <STDIN>;
- if ($answer eq "no\n") {
- print "exiting.... \n";
- $stop = 1;
- } else {
- $stop = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment