Friday, December 6, 2019

Basic Arithmetic Operations in PERL

Create and design a program that will ask the user to give two numbers and then the program will compute for the sum, difference, product, and quotient of the given numbers and then display the results on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.


https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.



Sample Program Output


Program Listing

# basic_math.pl
# Author   : Jake Rodriguez Pomperada,MAED-IT
# Date     : December 6, 2019  Friday
# Tools    : Perl  5 and Visual Studio Code Version 1.37.0
# Websites : www.jakerpomperada.com  and www.jakerpomperada.blogspot.com
# Email    : jakerpomperada@gmail.com
do {
system("cls");
print "\n\n";
print "\tBasic Arithmetic Operations in PERL";
print "\n\n";
print "\tEnter First Value  : ";
chomp($a =<>);
print "\tEnter Second Value : ";
chomp($b =<>);

$sum = ($a+$b);
$diff = ($a-$b);
$product = ($a * $b);
$quotient = ($a / $b);

print "\n";
print "\tThe sum of $a and $b is $sum.\n";
print "\tThe difference between $a and $b is $diff.\n";
print "\tThe product between $a and $b is $product.\n";
print "\tThe quotient between $a and $b is $quotient.";
print "\n\n";
print "\tDo you want to continue Y/N? : ";
chomp($reply =<>);
} while (uc $reply eq 'Y');
print "\n";
print "\tEnd of Program";
print "\n\n";

No comments:

Post a Comment