Tuesday, August 13, 2019

Convert Days to Years, Weeks and Days in Ruby


Write a program to ask the user to give input number of days and convert it to years, weeks and days and display the result on the screen using Ruby 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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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



Sample Program Output


Program Listing


# days.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 16, 2019   Thursday  3:17 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com
puts "\n\n"
print "\tConvert Days to Years, Weeks and Days";
puts "\n\n"
print "\tHow Many Days :  ";
days = gets;
days = days.to_i;

# Conversion in this portion 
    years = (days / 365);   # Ignoring leap year 
    weeks = (days % 365) / 7;
    days  = days - ((years * 365) + (weeks * 7));

print "\n\n";
print "\t===== DISPLAY RESULT ====="
print "\n\n";
print "\tNumber of Years  : #{years}.\n"
print "\tNumber of Weeks  : #{weeks}.\n"
print "\tNumber of Days   : #{weeks}."
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";

Kilometers To Miles Distance Converter in Ruby


Write a program that will ask the user a kilometer value and then the program will convert the given kilometer value into its miles equivalent and display the result on the screen in Ruby 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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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



Sample Program Output


Program Listing

# km_miles.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 16, 2019   Thursday  4:21 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com
puts "\n\n"
print "\tKilometers To Miles Distance Converter";
puts "\n\n"
# conversion factor for milses
miles_value = 0.621371

print "\tHow Many Kilometer(s) :  ";
kilometers = gets;
kilometers = kilometers.to_f;

# calculate miles 
miles = kilometers * miles_value;

print "\n";
print "\t===== DISPLAY RESULT =====";
print "\n\n";
print "\t%.2f kilometers is equal to "  % kilometers
print   "%.2f miles" % miles
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";



Simple Payroll Program in Ruby

Write a payroll program that will ask the user to give the number of days the employee's work and it's salary per day. The program will compute the gross salary of the employee.
In addition, the payroll program will also ask the user to give SSS, PAG-IBIG, BIR
and PHILHealth contribution and then the program will compute the total deductions
and net salary of the employee.

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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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


Program Listing


# payroll.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 17, 2019   Friday
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com
puts "\n\n"
print "\tSimple Payroll Program";
puts "\n\n"
print "\tHow Many Days Work?   ";
days = gets;
days = days.to_i;
print "\tSalary Per Day     : PHP ";
rate = gets;
rate = rate.to_f;

# Solving Gross Salary Here 
solve_gross = (days * rate);

puts "\tThe Gross Salary is PHP  %0.2f." % [solve_gross];
print "\n\n";
print "\tSSS Contribution        : PHP ";
sss = gets;
sss = sss.to_f;
print "\tPAG-IBIG Contribution   : PHP  ";
pag_ibig = gets;
pag_ibig = pag_ibig.to_f;
print "\tBIR Contribution        : PHP  ";
bir = gets;
bir = bir.to_f;
print "\tPHILHEALTH Contribution : PHP   ";
philhealth = gets;
philhealth = philhealth.to_f;

# Solving Total Deductions and Net Salary Here 
   
total_deductions = (sss+pag_ibig+bir+philhealth);
solve_net_salary = (solve_gross - total_deductions);

print "\t===== DISPLAY RESULT ====="
print "\n\n";
puts "\tGross Salary     : PHP %0.2f. " % [solve_gross];
puts "\tTotal Deductions : PHP %0.2f. " % [total_deductions];
print "\n\n";
puts "\tNet Salary       : PHP %0.2f. " % [solve_net_salary];
print "\tEND OF PROGRAM";
print "\n\n";





Person's Physical Attribute Program in Ruby

Write a program that will accept person name, height in inches, weight in pounds, eye color, teeth color, and hair color. The program will convert the height of the person from inches into centimeter and then it will compute the difference of person weight from pounds to kilogram equivalent and 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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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



Sample Program Output


Program Listing

# persons.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 17, 2019   Friday 11:31 AM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com
puts "\n\n"
print "\tPerson's Physical Attribute Program";
puts "\n\n"
print "\tWhat is the persons name?  ";
persons_name = gets.chomp
print "\tWhat is the persons height in inches? ";
height_value = gets;
height_value = height_value.to_f;
print "\tWhat is the persons weight in pounds? ";
pounds_value = gets;
pounds_value = pounds_value.to_f;
print "\tWhat is the persons eye's color?  ";
eyes = gets.chomp
print "\tWhat is the persons teeth color?  ";
teeth = gets.chomp
print "\tWhat is the persons hair color?  ";
hair = gets.chomp

# conversion done here
cm = 2.54;
height = height_value * cm;
kg = 2.2;
weight = pounds_value % kg;

print "\n";
print "\t===== DISPLAY RESULT ====="
print "\n\n";
puts "\tLet's talk about #{persons_name.upcase}.";
puts "\n"
puts "\tThe person is #{height} cm tall.";
puts "\tThe person is  %0.2f kg heavy." % [weight];
puts "\tThe person has a #{eyes.upcase} eyes and #{hair.upcase} hair.";
puts "\tThe person teeth are usually #{teeth.upcase} depending on the coffee.";
print "\n";
print "\tEND OF PROGRAM";
print "\n\n";



Celsius To Fahrenheit Temperature Conversion in Ruby

Create and design a program that will ask the user to give temperature value in Celsius and convert it into Fahrenheit temperature equivalent and display the result and 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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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



Sample Program Output


Program Listing

# celsius_fahrenheit.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 17, 2019   Friday  9:02 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com
puts "\n"
print "\tCelsius To Fahrenheit Temperature Conversion";
puts "\n\n"
print "\tGive the Temparature in Celsius : ";
celsius = gets;
celsius = celsius.to_f;

# Converting Celsius into Fahrenheit here 
  fahrenheit = (1.8 * celsius) + 32;

print "\n";
print "\t===== DISPLAY RESULT =====";
print "\n\n";
print "\tTemperature in Fahrenheit is %.2f degree's Fahrenheit. " % fahrenheit;
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";
  


Seconds to Hours,Minutes and Seconds Converter in Ruby


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.

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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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


Sample Program Output


Program Listing


# time.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 17, 2019   Friday  9:19 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmail.com and jakerpomperada@yahoo.com
puts "\n"
print "\tSeconds to Hours,Minutes and Seconds Converter";
puts "\n\n"
print "\tHow many seconds?  ";
time = gets;
time = time.to_i;

# Conversion starts here 

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

print "\n";
print "\t===== DISPLAY RESULTS =====";
print "\n\n";
print("\tHour(s)   : #{hours}");
print("\n");
print("\tMinute(s) : #{minutes}");
print("\n");
print("\tSecond(s) : #{seconds}");
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";
  





Average Grade Solver in Ruby


Write a program that will ask the student to give the prelim, midterm and final grade and then the program will compute the average grade of student and display the result 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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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


Sample Program Output


Program Listing


# grade.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 17, 2019   Friday  9:31 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmail.com and jakerpomperada@yahoo.com
puts "\n"
print "\tAverage Grade Solver";
puts "\n\n"
print "\tGive Prelim Grade    : ";
prelim = gets;
prelim = prelim.to_f;
print "\tGive Midterm Grade   : ";
midterm = gets;
midterm = midterm.to_f;
print "\tGive Final Grade     : ";
final = gets;
final = final.to_f;

# Solving of Average Grade here

solve_average =(prelim+midterm+final)/3;

print "\n";
print "\t===== DISPLAY RESULT =====";
print "\n\n";
print "\tThe student average grade is %.2f." % solve_average;
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";
  


Sum and Product of Two Numbers in Ruby


Create and Design a program that will ask the user to give two numbers and then the program will compute the sum and product of the given numbers and 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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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




Sample Program Output



Program Listing

# add_product.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 17, 2019   Friday  10:03 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com
puts "\n"
print "\tSum and Product of Two Numbers";
puts "\n\n"
print "\tGive First Number  : ";
a = gets;
a = a.to_i;
print "\tGive Second Number  : ";
b = gets;
b = b.to_i;

# Compute the sum and product
   sum = (a+b);
   product = (a*b);

print "\n";
print "\t===== DISPLAY RESULT =====";
print "\n\n";
printf("\tThe sum of #{a} and #{b} is #{sum}.");
printf("\n\n");
printf("\tThe product of #{a} and #{b} is #{product}.");
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";
  




Password Program in Turbo Pascal

In this article, I would like to share with you a simple password program written in Turbo Pascal.

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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.

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


Program Listing

Program  password;
uses crt;
var
w,i:integer;
pass,a:string[12];
try:char;
name:string;
begin
repeat
 randomize;
 textbackground(black);
 clrscr;
 gotoxy(32,6);
 write('P A S S W O R D');
 textcolor(black);
 gotoxy(29,8);readln(pass);
 textcolor(white);
 gotoxy(20,12); write('Verifying password ');
  for i:=40 to 60 do
  begin
    gotoxy(i,12);
    sound(random(1000+i));

    write('');
    delay(7000);
  end;
 if pass = '123' then
  begin
   clrscr;
   gotoxy(12,20);
   write(' You are one of the authorized person(s) ');
  end;
  nosound;
 if pass <> '123' then
  begin
   clrscr;
   gotoxy(31,12);  write('Wrong Password');
   gotoxy(25,14);write('Do you want another try Y/N : ');
  end;
  nosound;
   readln(try);
until (try = 'N') or (try = 'n');
readln;
end.