Wednesday, July 17, 2019

Year Level Checker Using Hashes in Ruby

Write a program uses hashes that will ask the student's name and year level status by selecting 1-Freshmen, 2-Sophomore, 3-Juniors, and 4-Seniors  then the program will display the name of the student's name in uppercase and the year level of the students 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

year_level.rb

# year_level.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 17, 2019   Tuesday   4: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

  year_level =[1, 2, 3, 4]
  year_status = ['Freshmen','Sophomore','Juniors','Seniors']
  print "\n"
  print "\t===== Year Level Checker Using Hashes ====="
  print "\n\n"
  print "\tWhat is your name  : ";
  name =gets.chomp  
  print "\n"
  print "\t1-Freshmen, 2-Sophomore, 3-Juniors and 4-Seniors\n";
  print "\n";
  print "\tWhat is your year level? : ";
  select = gets.to_i
  position = 0
  position = year_level.index(select)
if position != nil then
  print "\n\n"
  print "\tHello #{name.upcase} your year level is #{year_status[position]}."
else
  print "\n\n" 
  print "\tSorry #{name.upcase} your year level is unknown."
end
print "\n\n";
print "\tEnd of Program"


Tuesday, July 16, 2019

Civil Status Checker in PHP

A simple program that I wrote in PHP that will ask the user to give a number and then the program will check the civil status based on the given number by the 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

index.php

<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: arial;
}
</style>
<?php
$display="";
$civil=$_POST['civil'];
if(isset($_POST['clear'])){
$civil="";   
$display="";
}
?>
<meta charset="UTF-8">
<title>Civil Status Checker Using PHP</title>
</head>
<body>
<h2>Civil Status Checker Using PHP</h2>
<h4>Created By Mr. Jake R. Pomperada</h4>
<form action="" method="post">
<b>Give a Number</b><br/><br>
<input type="text" name="civil" value="<?php echo $civil; ?>" autofocus><br/><br>
<input type="submit" name="submit" value="Submit">  &nbsp;&nbsp;&nbsp;

<input type="submit" name="clear" value="Clear">
</form>
<br>
<?php
if(isset($_POST['submit'])){
$civil=$_POST['civil'];

if ($civil == 1) {
$display = "You are Single.";
echo $display;
} else if ($civil == 2) {
$display =  "You are Married.";
echo $display;
} else if ($civil == 3) {
$display =  "You are Annulled.";
echo $display;
}else if ($civil == 4) {
$display =  "You are Widow.";
echo $display;
} else if ($civil == 5) {
$display =  "You are Separated.";
echo $display;
}
else {
$display =  "Invalid Year Level. Try Again";
echo $display;
}
  

}
?>
</body>
</html>





Monday, July 15, 2019

Area of the Circle Using PHP

Here is a simple program to show how to solve the area of the circle using PHP.

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.php

<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
font-family: arial;
}
</style>
<?php
$radius=$_POST['radius'];
?>
<meta charset="UTF-8">
<title>Area of the Circle Using PHP</title>
</head>
<body>

<h2>Area of the Circle Using PHP</h2>

<h4>Created By Mr. Jake R. Pomperada</h4>
<form action="" method="post">
<b>Give Radius</b><br/><br>
<input type="text" name="radius" value="<?php echo $radius; ?>" ><br/><br>
<input type="submit" name="submit" value="Submit">
</form>
<br>
<?php
if(isset($_POST['submit'])){
//area = pie * radius * radius
define('PI','3.14');
$radius=$_POST['radius'];
$area= PI * $radius * $radius;
echo "Area of the Circle is ".round($area,2);
}
?>
</body>
</html>


Fruits Listing Using Two Dimensional Arrays in PHP

Here is a simple program to show you how to use two-dimensional array in PHP in our example we are dealing with different kinds of fruits.

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

two.php

<!DOCTYPE html>
<html>
<body>

<?php


$fruits = array
  (
  array("Avocado",21,16),
  array("Banana",13,18),
  array("Santol",15,54),
  array("Mango",12,45),
  array("Orange",65,16),
  array("Cherry",32,44),
  array("Pear",651,125),
  array("Apricot",321,78)
  );
  
echo "<h2> Fruits Listing Using Two Dimensional Arrays in PHP </h2>";

for ($row = 0; $row < 8; $row++) {
  echo "<p><b>Row number $row</b></p>";
  echo "<ul>";
  for ($col = 0; $col < 3; $col++) {
    echo "<li>".$fruits[$row][$col]."</li>";
  }
  echo "</ul>";
}
?>

</body>
</html>





Fruits Listing Using Arrays in PHP

Here is a simple program to show you how to use one-dimensional array in PHP in our example we are dealing with different kinds of fruits.

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

fruits.php

<?php
// Jake R. Pomperada
// July 15, 2019
// arrays with different fruits


$fruits = array("Avocado","Banana","Apricot",
            "Cherry","Coconut","Peach",
            "Pear","Guava","Mango","Orange",
            "Raspberry","Santol","Indian Mango");

$arrlength = count($fruits);

echo "<h2> Fruits Listing Using Arrays in PHP </h2>";

for($x = 0; $x < $arrlength; $x++) {
    echo "<b>" .$fruits[$x]."</b>";
    echo "<br>";
}
?>







Friday, July 12, 2019

Comparing Two Strings Using Ruby

Here is a sample program to compare two strings in Ruby if the two string is identical or not to one another.

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

compare.rb

# compare.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 10, 2019   Wednesday  10:00 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

  print "\n\n"
  print "\t===== Comparing Two Strings ====="
  print "\n\n"

  s1 = "Jacob"  
  s2 = "Jacob"  
  s3 = s1  
  
  print "\tThe given string value no. 1 :  #{s1}\n"
  print "\n"
  print "\tThe given string value no. 2 :  #{s2}\n"
  print "\n"
  
  if s1 == s2  
  print "\tBoth Strings have identical content\n"  
else  
  print "\tBoth Strings do not have identical content\n"  
end  
if s1.eql?(s2)  
  print "\tBoth Strings have identical content\n"  
else  
  print "\tBoth Strings do not have identical content\n"  
end  
if s1.equal?(s2)  
  print "\tTwo Strings are identical objects\n"  
else  
  print "\tTwo Strings are not identical objects\n"  
end  
if s1.equal?(s3)  
  print "\tTwo Strings are identical objects\n"  
else  
  print "\tTwo Strings are not identical objects\n"  
end  
  print "\n\n";
  print "\tEnd of Program"



Count Letters in a String Using Ruby

Here is a simple program to ask the user to give a string and then the program will ask the user what letter to be counted in the given string. The program will count the number of occurrence of the given string 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

count_letter.rb

# count_letter.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 9, 2019   Tuesday  12:49 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


loop do
  print "\n\n"
  print "\t===== Count Letters in a String ====="
  print "\n\n"
  print "\tGive a String : "
  str_val = gets.chomp
  print "\n"
  print "\tWhat letter to be count ? : "
  letter_val = gets.chomp

    display = str_val.downcase.count(letter_val)

    display_str = str_val.upcase
    display_letter = letter_val.upcase

    print "\n"
    print "\tThe given string is #{display_str}."
    print "\n\n"
    print "\tThe number of occurrence of the letter" 
    print " #{display_letter} is #{display}."
    puts "\n\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



Greet the Visitor Using Ruby

Here is a sample program to greet the visitor by asking the name of the visitor 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

greet_visitor.rb

# greet_visitor.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 9, 2019   Tuesday  12:49 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
# input variables


print "\n\n"
print "\t===== Greet the Visitor  ====="
print "\n\n"
print "\tWhat is your name? "
name = gets.chomp
display_name = name.split(/\.?\s+/, 3)

print "\n"
print "\tHow  old are you? "
years = gets.chop.to_s

print "\n"
print "\tHello #{display_name[0].capitalize} #{display_name[1].capitalize}" 
print " #{display_name[2].capitalize} at #{years} years old."
print "\n\n"
print "\tEnd of Program"
print "\n\n"




COUNT VOWELS AND CONSONANTS IN A STRING

Write a program to ask the user to give a string and then the program will count the number of vowels and consonants 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

vowels_consonants.rb

# vowels_consonants.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : July 9, 2019   Tuesday  12:07 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


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


def count_consonants(string)
    consonants = 0
    counter = 0
    while counter < string.length do
      if (string[counter]=="b" || 
         string[counter]=="c" || 
         string[counter]=="d" ||
         string[counter]=="f" ||
         string[counter]=="g" ||
         string[counter]=="h" || 
         string[counter]=="j" || 
         string[counter]=="k" ||
         string[counter]=="l" ||
         string[counter]=="m" ||
         string[counter]=="n" ||
         string[counter]=="p" || 
         string[counter]=="q" || 
         string[counter]=="r" ||
         string[counter]=="s" ||
         string[counter]=="t" ||
         string[counter]=="v" ||
         string[counter]=="w" || 
         string[counter]=="x" || 
         string[counter]=="y" ||
         string[counter]=="z" )
         consonants += 1
      end
      counter += 1
    end
    return consonants
end

string_input =""
answer = ""

until answer.downcase == "n" do 
 print "\n\n"
 print "\t===== COUNT VOWELS AND CONSONANTS IN A STRING  ====="
 print "\n\n"
 print "\tGive a String : "
 string_input = gets.chop

 display_vowels =     count_vowels(string_input.downcase)
 display_consonants = count_consonants(string_input.downcase)

print "\n\n"
print "\tThe number of vowels     is #{display_vowels}."
print "\n\n"
print "\tThe number of consonants is #{display_consonants}."
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"