Showing posts with label Simple Payroll Program in Ruby. Show all posts
Showing posts with label Simple Payroll Program in Ruby. Show all posts

Tuesday, August 13, 2019

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";