Thursday, July 18, 2019

Positive and Negative Numbers Using Hashes in Ruby


Write a program uses hashes that will check and list down the series of positive and negative numbers from 1 to 12 to 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

positive_negative.rb


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

  print "\n"
  print "\t===== Positive and Negative Numbers Using Hashes ====="
  print "\n\n"

val_num  = {   
    1 =>1,2 =>-2,3 =>3,4 =>-4,
    5 => 5,6 =>-6,7 =>7,8 =>-8,
    9 =>9,10 =>-10,11 => 11,12 =>-12   
    }   
 print("\tList of Postive Numbers")
 print("\n\n")
 print("\t")
val_num.each do |key, value|
  if (value >=0)
    print " #{value} " 
   end    
end
 print("\n\n")

 print("\tList of Negative Numbers")
 print("\n\n")
print("\t")
 val_num.each do |key, value|
   if (value < 0)
     print " #{value} " 
    end    
 end

 print "\n\n";
 print "\tEnd of Program"


Wednesday, July 17, 2019

Civil Status Checker Using Hashes in Ruby

Write a program uses hashes that will ask the user's name and civil status by selecting 1-Single, 2-Married, 3-Widow, 4-Divorce, and 5-Separate and then the program will display the name of the user's name in uppercase and the civil status of 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

civil_status.rb

# civil_status.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

  civil_option =[1, 2, 3, 4, 5]
  status = ['Single','Married','Widow','Divorce','Separate']
  print "\n"
  print "\t===== Civil Status Checker Using Hashes ====="
  print "\n\n"
  print "\tWhat is your name  : ";
  name =gets.chomp  
  print "\n"
  print "\t1-Single, 2-Married, 3-Widow, 4-Divorce and 5-Separate\n";
  print "\n";
  print "\tGive your civil status : ";
  select = gets.to_i
  position = 0
  position = civil_option.index(select)
if position != nil then
  print "\n\n"
  print "\tHello #{name.upcase} your civil status is #{status[position]}."
else
  print "\n\n" 
  print "\tSorry #{name.upcase} your civil status is unknown."
end
print "\n\n";
print "\tEnd of Program"



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"