Wednesday, July 10, 2019

Kilograms To Pounds Converter in Ruby

Write a program to ask the user to give value in kilograms and then it will convert it into pounds equivalent using methods. 

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

kg_pounds.rb

# kg_pounds.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 18, 2019   Tuesday  2:59 PM  
# Address  : Bacolod City, Negros Occidental
# Tools    : Sublime Text and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com

def kilograms_pounds(kg)
  pounds = kg * 2.20462262;
  return(pounds.round(2));
end

print "\n\n";
print "\tKilograms To Pounds Converter";
print "\n\n";
print "\tWhat is the Kilogram value? ";

kg_val = gets.to_i;

convert = kilograms_pounds(kg_val);

print "\n";
print "\tDISPLAY RESULTS"
print "\n\n";
print("\tThe #{kg_val} Kilogram(s) = #{convert} Pound(s).");

Decimal To Binary Number Converter in Ruby


Write a program that will ask the user to give temperature in Celsius and then the program will convert into Fahrenhe it temperature equivalent using methods 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

decimal_binary.rb

# decimal_binary.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 18, 2019   Tuesday  2:17 PM  
# Address  : Bacolod City, Negros Occidental
# Tools    : Sublime Text and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com

def dec2bin(number)
    number = Integer(number)
    if(number == 0) then 0 end
        
    ret_bin = ""
    while(number != 0)
        ret_bin = String(number % 2) + ret_bin
        number = number / 2
    end
    ret_bin
end

print "\n\n";
print "\tDecimal To Binary Number Converter";
print "\n\n";
print "\tGive a Number : ";

val_num = gets.to_i;

convert =  dec2bin(val_num);

print "\n";
print "\tDISPLAY RESULTS"
print "\n\n";
print("\tThe decimal of #{val_num} its binary equivalent is #{convert}.");
print "\n\n";
print "\tEnd of Program";
print "\n";






Celsius to Fahrenheit Temperature Converter in Ruby

Write a program that will ask the user to give temperature in Celsius and then the program will convert into Fahrenheit temperature equivalent using methods 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

temperature.rb


# temperature.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 17, 2019   Monday  2:45 PM  
# Address  : Bacolod City, Negros Occidental
# Tools    : Sublime Text and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com

def fahrenheit_solve(celsius)
 return((celsius.to_f * 9 / 5) + 32);
end

celsius = 0.00;

print "\n\n";
print "\tCelsius to Fahrenheit Temperature Converter";
print "\n\n";
print "\tGive tempeature in celsius : ";

celsius = gets.to_f

temp = fahrenheit_solve(celsius)

print "\n";
print "\tDISPLAY RESULTS"
print "\n\n";
puts "\tThe temperature in fahrenheit is %.2f°F." % temp
print "\n";
print "\tEnd of Program";
print "\n";



Parameter and Area of the Circle Solver in Ruby

Write a program which accepts the radius of a circle from the user and compute the parameter and area using methods 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

area_circle.rb

# area_circle.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 17, 2019   Monday  2:37 PM  
# Address  : Bacolod City, Negros Occidental
# Tools    : Sublime Text and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com

def perimeter_solve(radius)
 return(2 * 3.141592653 * radius);
end

def area_solve(radius)
 return(3.141592653 * radius * radius);
end

radius = 5.00;
perimeter = 0.00;
area = 0.00;

print "\n\n";
print "\tParameter and Area of the Circle Solver";
print "\n\n";
print "\tRadius of the circle: ";

radius = gets.to_f
perimeter =  perimeter_solve(radius);
area = area_solve(radius);

print "\n";
print "\tDISPLAY RESULTS"
print "\n\n";
puts "\tThe perimeter is %.2f of the circle." % perimeter
print "\n";
puts "\tThe area is %.2f of the circle." % area
print "\n";
print "\tEnd of Program";
print "\n";


Swap Two Numbers in Ruby


Design and create a program that will ask the user to give two integer numbers and then the program will swap the arrangement of two numbers using methods 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

swap.rb


# swap.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 17, 2019    Monday  1:18 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

def swap(a,b)
    temp = a
    a = b
    b = temp
    print "\tA = #{a} and B = #{b} ";
    return a,b;
end

puts "\n\n"
print "\tSwap Two Numbers";
puts "\n\n"
print "\tGive First Value  : ";
a = gets;
print "\tGive Second Value : ";
b = gets;

a = a.to_i;
b = b.to_i;
print "\n\n";
print "\tBefore Swapping";
print "\n\n";
print "\tA = #{a} and B = #{b} ";
print "\n\n";
print "\t===== DISPLAY RESULT ====="
print "\n\n";
print "\tAfter Swapping";
print "\n\n";
swap(a,b)
print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";



Basic Math Operations in Ruby

Create and Design a program that will ask the user to give two numbers and then the program will compute the sum, difference, product, and quotient of the given numbers using methods 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 Listing


Program Listing

math.rb


# math.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 15, 2019    Wednesday  2;16 PM
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE for JavaScript and Web Developers 
#            and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com

def add(a,b)
  return(a+b);
end

def subtract(a,b)
  return(a-b);
end

def multiply(a,b)
  return(a*b);
end

def divide(a,b)
  return(a/b);
end

puts "\n\n"
print "\tBasic Math Operations";
puts "\n\n"
print "\tGive First Value  : ";
val1 = gets;
print "\tGive Second Value : ";
val2 = gets;

val1 = val1.to_i;
val2 = val2.to_i;

sum = add(val1,val2);
difference = subtract(val1,val2);
product = multiply(val1,val2);
quotient = divide(val1,val2);

print "\n\n";
print "\t===== DISPLAY RESULT ====="
print "\n\n";
print "\tThe sum of ",val1," and ",val2," is ",sum,".\n";
print "\tThe difference between #{val1} and #{val2} is #{difference}.\n";
print "\tThe product of #{val1} and #{val2} is #{product}.\n";
print "\tThe quotient between #{val1} and #{val2} is #{quotient}.";
puts "\n\n"
print "\tEnd of Program";
puts "\n"


Power of a Number in Ruby


Design and create a program that will ask the user to give base and exponent values using methods and then the program will compute the power value of the number and then 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

power.rb


# power.rb
# Written By Mr. Jake Rodriguez Pomperada,BSCS,MAED-IT
# Tools : Ruby 2.6.3 and Sublime Text Editor 
# June 17, 2019    Monday   12:12 PM
# Bacolod City, Negros Occidental
# Website       : http://www.jakerpomperada.com
# Email Address : jakerpomperada@gmail.com and jakerpomperada@yahoo.com

def square_solver(base,exponent)
  return(base ** exponent);
end

puts "\n\n"
print "\tPower of a Number";
puts "\n\n"
print "\tEnter a Base Number : ";
base = gets;
print "\tEnter an Exponent   : ";
exponent = gets;

base = base.to_i;
exponent = exponent.to_i;

solve_power = square_solver(base,exponent);

print "\n\n";
print "\tDISPLAY RESULTS";
print "\n\n";
print "\t#{base} ^ #{exponent} = #{solve_power}";
puts "\n\n";
print "\tEnd of Program";
puts "\n";



Addition of Three Numbers Using Methods in Ruby

Write a program that will ask the user to give three numbers and then the program will compute the total sum of the three numbers using methods 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

addition.rb


# addition.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 17, 2019   Monday 8:19 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

def add_all(num1, num2, num3)
  return num1 + num2 + num3
end


puts "\n\n"
print "\tAddition of Three Numbers Using Methods";
puts "\n\n"
print "\tGive First Value  : ";
val1 = gets;
print "\tGive Second Value : ";
val2 = gets;
print "\tGive Third Value  : ";
val3 = gets;

val1 = val1.to_i;
val2 = val2.to_i;
val3 =  val3.to_i;
sum = sum.to_i;

sum = add_all(val1,val2,val3);

print "\n";
print "\tThe sum of ",val1,",",val2," and ",val3," is ",sum,".";
puts "\n\n"
print "\tEnd of Program";
puts "\n"