Monday, November 4, 2019

Convert Days Into Years,Weeks and Days in PERL

I wrote a program using Perl as my programming language that will ask the user to give number of days and then the program will convert specified days into years, weeks and days.

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 Page 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

# years_weeks_days.pl
# Author : Jake Rodriguez Pomperada, MAED-IT
# Date   : November 4, 2019   Monday
# Email  : jakerpomperada@gmail.com
do {
system("cls");
print "\n\n";
print "\tConvert Days Into Years,Weeks and Days in PERL";
print "\n\n";
print "\tHow many days?  : ";
chomp($days =<>);

# Converts days to years, weeks and days
$years = (int($days) / 365); 
$weeks = (int($days) % 365)/7;
$days =  int($days) - ((int($years)*365) + (int($weeks)*7));

$display_years  = int($years);
$display_weeks  = int($weeks);
$display_days   = int($days);

print "\n";
print "\tDISPLAY RESULTS";
print "\n\n";
print "\tYears : $display_years\n";
print "\tWeeks : $display_weeks\n";
print "\tDays  : $display_days\n";

print "\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