Friday, July 12, 2019

COUNT VOWELS IN RUBY

Write a program that will ask the user to give a string and then our program will count the number of vowels based on the given string of our user.

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

vowels.rb


# vowels.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 9, 2019   Tuesday  8:28 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@gmail.com and jakerpomperada@yahoo.com


def count_vowels(string)
    vowels = 0
    counter = 0
    while counter < string.length do
      if string[counter]=="a" || string[counter]=="e" || string[counter]=="i" || string[counter]=="o" || string[counter]=="u"
        vowels += 1
      end
      counter += 1
    end
    return vowels
end

string_input =""
answer = ""

until answer.downcase == "n" do 
 print "\n\n"
 print "\t===== COUNT VOWELS IN RUBY ====="
 print "\n\n"
 print "\tCreated by Mr. Jake R. Pomperada"
 print "\n\n"
 print "\tGive a String : "
 string_input = gets.chop

 display_result =count_vowels(string_input.downcase)

print "\n\n"
print "\tThe number of vowels is #{display_result}."
print "\n\n"
 print "\tDo you want to continue Y/N ? : "
 answer= gets.chop
end  
 print "\n\n"
    print "\tEnd of Program"
    print "\n\n"

Palindrome Program in Ruby


Write a program that will ask the user to give a string or a word and then the program will
check if the given word or a string is a palindrome or not a palindrome.  We can be called a word a palindrome if we read the word forward and backward the spelling and the sound is the same.

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

palindrome.rb


# palindrome.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 9, 2019   Tuesday  8:14 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@gmail.com and jakerpomperada@yahoo.com

def check_palindrome(str)
  if str.reverse == str
    puts "\n\n";
    puts "\tThe given word #{str.upcase} is a palindrome."
 puts "\n";
  else
 puts "\n";
    puts "\tThe given word #{str.upcase} isn't a palindrome."
 puts "\n";
  end
end

loop do
 print "\n\n";
 print "\tPalindrome Program"
 print "\n\n";
 print "\tEnter a String : ";
 str_test = gets.chomp
 check_palindrome(str_test.upcase)
 puts "\n";
  print "\tDo you want to continue? (y/n) : "
  answer = gets.chomp.downcase
  if answer == "n"
 print "\n\n";
    print "\tEnd of Program";
    print "\n\n";
 break
  end
end


Word Count Program in Ruby


Write a program that will ask the user to give a sentence and then the program will count the number of words in the given sentence and display the results 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

word_count.rb

# word_count.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 9, 2019  5:48 AM  Tuesday
# 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 wordcount(value)
    value.split(/\s+/).length
end

print "\n\n";
print "\tWord Count Program";
print "\n\n";
print "\tGive a Sentence  : "
str = gets.chomp
print "\n";
print "\tThe number of words in a given sentence is #{wordcount(str)}.";
print "\n\n";
print "\tEnd of Program";
print "\n";



Word Count Program in Ruby

Write a program that will ask the user to give a sentence and then the program will count the number of words in the given sentence and display the results 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

word_count.rb

# word_count.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 9, 2019  5:48 AM  Tuesday
# 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 wordcount(value)
    value.split(/\s+/).length
end

print "\n\n";
print "\tWord Count Program";
print "\n\n";
print "\tGive a Sentence  : "
str = gets.chomp
print "\n";
print "\tThe number of words in a given sentence is #{wordcount(str)}.";
print "\n\n";
print "\tEnd of Program";
print "\n";


Capitalize the First Letter of given String in Ruby


Write a program that will ask the user to give their first name, middle name, last name and then the program will capitalize the first letter of the first name, middle name, and last name and then greet the user 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

capitalize.rb


# capitalize.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 9, 2019  5;23 AM
# 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

print "\n\n";
print "\tCapitalize the First Letter of given String";
print "\n\n";
print "\tGive your First Name   : "
fname = gets.chomp
print "\n";
print "\tGive your Middle Name  : "
mname = gets.chomp
print "\n";
print "\tGive your Last Name    : "
lname = gets.chomp
print "\n\n";
print "\tWelcome #{fname.capitalize} #{mname.capitalize} #{lname.capitalize}.";
print "\n\n";
print "\tEnd of Program";
print "\n";





Wednesday, July 10, 2019

Odd and Even Number Checker Using Methods in Ruby

Write a program using if-else statement to ask the user to give a number and then the program will check and determine if the given number by the user is odd or even number and displays the results on the screen 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

odd_even.rb

# odd_even.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 19, 2019   Wednesday  1: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

def check_odd_even(num_val)
  if(num_val % 2 == 0)
     print("\tThe given number #{num_val} is a EVEN number.");
  else    
     print("\tThe given number #{num_val} is a ODD number.");
  end  
end

puts "\n\n"
print "\tOdd and Even Number Checker";
puts "\n\n"

print "\tGive a number  : ";
num = gets.chomp
num = num.to_i;

print "\n";
print "\t===== DISPLAY RESULT ====="
print "\n\n";

check_odd_even(num);

print "\n\n";
print "\tEND OF PROGRAM";
print "\n\n";



Feet To Meter Converter in Ruby


Write a program that will ask the user value in feet and then it will convert into meters equivalent and display the result on the screen 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

 feet_meter.rb


# feet_meter.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 19, 2019   Wednesday  12: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 feet_meter(ft)
  meters = (ft / 3.2808399);
  return(meters.round(2));
end

print "\n\n";
print "\tFeet To Meter Converter";
print "\n\n";
print "\tWhat is the Feet value? ";

feet_val = gets.to_i;

convert = feet_meter(feet_val);

print "\n";
print "\tDISPLAY RESULTS"
print "\n\n";
print("\tThe #{feet_val} Feet(s) = #{convert} Meter(s).");
print "\n\n";
print "\tEnd of Program";
print "\n";




Fahrenheit to Celsius Temperature Converter in Ruby

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

fah_celsius.rb


# fah_celsius.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 19, 2019   Wednesday  9:48 AM  
# 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 celsius_solve(fah)
  return((fah.to_f - 32 ) * 5/9);
end

celsius = 0.00;

print "\n\n";
print "\tFahrenheit to Celsius Temperature Converter";
print "\n\n";
print "\tGive Tempeature in Fahrenheit : ";

fahrenheit = gets.to_f

temp = celsius_solve(fahrenheit);

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





Factorial Number Converter in Ruby

Write a program that will ask the user to give integer number and then the program will compute the factorial value of the given number and display the results on the screen 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

factorial.rb

# factorial.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : June 19, 2019  Wednesday   8:40 AM  
# 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 factorial(n=0)
  (1..n).inject(:*)
end

print "\n\n";
print "\tFactorial Number Converter";
print "\n\n";
print "\tGive a Number : ";

num_val = gets.to_i;

solve= factorial(num_val);

print "\n";
print "\tDISPLAY RESULTS"
print "\n\n";
print("\tThe factorial value of #{num_val} is #{solve}.");
print "\n\n";
print "\tEnd of Program";
print "\n";