Saturday, November 9, 2019

Seconds to Hours,Minutes and Seconds Converter in PERL

Create and design a program that will ask the user to give the number in seconds and then the program will convert its hours, minutes and seconds equivalent and display the result on the screen using Perl as our programming language.

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?id=100009212511791

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

# temp.pl
# Author    :  Jake Rodriguez Pomperada,MAED-IT
# Date        :  November 9, 2019  Saturday    9:00 AM
# Location  :  Bacolod City, Negros Occidental
# Tools        :  Perl  5 and Visual Studio Code Version 1.37.0
# Websites :  www.jakerpomperada.com   and www.jakerpomperada.blogspot.com
# Email       :  jakerpomperada@gmail.com

print "\n";
printf("\tSeconds to Hours,Minutes and Seconds Converter in PERL");
printf("\n\n");
printf("\tHow many seconds : ");
chomp($time =<>);

# Conversion starts here 

$hours = int($time / 3600);
$minutes = int(($time % 3600) / 60);
$seconds = int(($time % 3600) % 60);

printf("\n");
printf("\t===== DISPLAY RESULTS =====");
printf("\n\n");
printf("\tHour(s)   : %d ",$hours);
printf("\n");
printf("\tMinute(s) : %d ",$minutes);
printf("\n");
printf("\tSecond(s) : %d ",$seconds);
print "\n\n";
print "\tEnd of Program";
print "\n";







No comments:

Post a Comment