Sunday, May 17, 2015

Product of Two Numbers in Java Using Scanner Library

In this article I would like to share with you a very simple program that I wrote in Java I called this program Product of Two Numbers in Java Using Scanner Library. I am just a beginner in terms of using Eclipse Java IDE text editor while I'm learning how to create a project I just wrote this very simple program that will ask the user to enter two numbers and then it will display the product of the two numbers to the user.

I find the eclipse ide editor easy to use and user friendly in a sense it display a command while you are type your code it is called intellisense function that can be found in Microsoft Visual Studio.

I hope you will my work useful and learning Java programming. If you have some questions feel free to send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me you can text or call me at this number 09173084360.

Thank you very much and God Bless.



Sample Program Output

Program Listing

package demo;

import java.util.Scanner;

public class Demo {

 public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.println("Product of Two Numbers");
System.out.print(" Enter first value : ");
int val1 = scan.nextInt();
System.out.print(" Enter second value : ");
int val2 = scan.nextInt();
int product = val1 * val2;
System.out.print("The product of "+ val1  + " and " 
+ val2 + " is " + product + ".");
     } 


}








Saturday, May 16, 2015

Area of a Circle Using AngularJS

In this article I wrote a very simple application using AngularJS as our Javascript Framework that will solve the area of a circle by asking the user to enter the radius of the circle.  The code is very simple and straight forward. I am still a beginner in AngularJS programming as this moment I find it very easy to write and test our sample program.


I hope you will find our program useful in learning how to program using AngularJS one of the most popular Javascript Framework in our community right now. If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can reach me in this mobile number 09173084460.

Thank you very much and God Bless us all.






Sample Program Output


Complete Program Listing

<html>
<head> 
<title> Area of the Circle in AngularJS </title>
</head>
<style>
p {
   color:blue;
   font-family: "arial";
   font-style: bold;
   font-size: 18px;
  }
  
h3{
   color:red;
   font-family: "arial";
   font-style: bold;
   font-size: 20px;
  }
  
 input[type='text'] 
   { 
   color:blue;
   font-family: "arial";
   font-size: 18px;
   font-style: bold;
   }
 </style>
<script type="text/javascript" src="angular.js"></script>
<body bgcolor="lightgreen">
<br><br>
<h3>Area of the Circle in AngularJS</h3>
<div ng-app="">
    <p>Enter the radius of circle:
        <input type="text" ng-model="radius" maxlength="5" size="3"/>
    </p><br>
    <p>The radius of the circle is {{radius}} its area is {{ radius * radius * 3.14159}}. m&#178</p>
<p> The circumference of the circle is {{ 2 * radius * 3.14159}}. m </p>
</div>.
</body>
</html>




Sunday, May 10, 2015

Addition of Three Numbers in AngularJS

In this article I would like to share with you a sample program that will add the sum of three numbers using AngularJS as our Javascript Framework. What does the program will do is very simple it will ask the user to enter three number and our program will automatically will sum up the values of the three numbers provided by our user.

If you like my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can call and text me in this number 09173084360.

Thank you very much and God Bless.



Sample Program Output


Program Listing


<html>
<head> 
<title> Addition of Three Numbers in AngularJS </title>
</head>
<style>
p,h3 {
   color:blue;
   font-family: "arial";
   font-style: bold;
   size: 16;
  };
 </style>
<script type="text/javascript" src="angular.js"></script>
<body bgcolor="lightgreen">
<br><br>
<h3>Addition of Three Numbers in AngularJS</h3>
<div ng-app="">
    <p>First Number:
        <input type="text" ng-model="a" placeholder="enter a number" />
    </p>
    <p>Second Number:
        <input type="text" ng-model="b" placeholder="enter a number"/>
    </p>
  <p>Third Number:
        <input type="text" ng-model="c" placeholder="enter a number" />
    </p><br>
    <p>The total sum of {{a}}, {{b}} and {{c}} is {{ a -- b -- c }}.</p>
</div>
</body>
</html>


Sunday, May 3, 2015

Display Record From Text Area in PHP and MySQL

In this article I would like to share with you a program that I wrote in PHP and MySQL that will display the record from text area. This code is very useful is you are trying to create a news or blog website that will save news articles that are very long. I try to make the code much easier to understand by beginners in PHP and MySQL programming.


If you like my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can call and text me in this number 09173084360.

Thank you very much and God Bless.



Sample Screen Shoot



Saturday, May 2, 2015

Factorial of Numbers Using Recursion Pointers in C++

Recursion is one of the most common method that is being used in programming to solve a problem for example factorial of numbers in C++. In this article I will show you how to solve factorial of number using recursion with pointers in C++. The code is very straight forward it uses functions to accomplish the result. I hope you will find my work useful in your study of C++ programming.

If you like my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can call and text me in this number 09173084360.

Thank you very much and God Bless.



Sample Output


Program Listing


#include <iostream>

using namespace std;

int factorial (int num)
{
 if (num==1)
  return 1;
 return factorial(num-1)*num;
}

main() {
    int value=0;
    int *p;
    cout << "\t Recursion using Pointers";
    cout << "\n\n";
    cout << "Enter a Number :=> ";
    cin >> value;
    p = &value;
    cout << "\n";
    cout <<"The factorial value of " << value
        << " is " << factorial(value) << ".";
    cout << "\n\n";
    system("pause");
}



Bubble Sort in Descending Order Using Pointers in C++

In this article I would like to share with you a bubble sort program that I wrote in C++ that uses pointers as its data structure. What does our program will do is to as the user how many numbers to be sorted using Bubble Sort sorting algorithm. It will display the original arrangement of numbers and after which it will display the sorted numbers in descending order.


If you like my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can call and text me in this number 09173084360.

Thank you very much and God Bless.




Sample Program Output


Program Listing


#include <cstdlib>
#include <iostream>

using namespace std;

int compare(int, int);
void sort(int[], const int);
void swap(int *, int *);

int compare(int x, int y)
{
     return(x < y);
}

void swap(int *x, int *y)
{
     int temp;
     temp = *x;
     *x = *y;
     *y = temp;
}

void sort(int table[], const int n)
{
     for(int i = 0; i < n; i++)
     {
          for(int j = 0; j < n-1; j++)
          {
               if(compare(table[j], table[j+1]))
                    swap(&table[j], &table[j+1]);
          }
     }
}

int quantity;
int* tab;

int main(int argc, char *argv[])
{
    cout << "\t\tBUBBLE SORT IN DESCENDING ORDER USING POINTERS";
    cout << "\n\n\t\t Created By: Mr. Jake R. Pomperada, MAED-IT";
    cout << "\n\n";   
    cout << "How Many Items :=> ";
cin >> quantity;
tab = new int [quantity];
cout << "Input numbers: \n\n";
for (int i = 0; i < quantity; i++)
{
    int x = i;
    cout << "#" << ++x << ": ";
    cin >> tab[i];
}

cout << "\nBefore sorting: ";
for (int i = 0; i < quantity; i++)
{
     cout << tab[i] << " ";
}

cout << "\nAfter sorting: ";
sort(tab, quantity);
for(int i = 0; i < quantity; i++)
{
     cout << tab[i] << " ";
}
 cout << "\n\n";
    system("PAUSE");
    return EXIT_SUCCESS;
}












Friday, April 10, 2015

Product of Two Numbers Using Jquery

A simple program that I wrote using JQuery that will find the product of two numbers given by our user. The code is very easy to understand and use you will learn how to use button which interacts with JQuery.

If you like my work please send me an email at jakerpomperada@gmail.com andjakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can call and text me in this number 09173084360.

Thank you very much and God Bless.




                            Sample Program Output


Program Listing

<!-- Product of Two Numbers Using JQuery -->
<!-- April 10, 2015    Friday   --->
<!-- Written By: Mr. Jake R. Pomperada, MAED-IT -->
<!-- Tools : HTML,CSS and JQuery -->
<html>
<head>
<title> 
Product of Two Numbers Using JQuery 
</title>
</head>
<style>
body { 
  font-size:20px; 
  font-family:arial;
  color:blue;
  } 
label{
    display: table-cell;
    text-align: justify;
}
input {
  display: table-cell;
}
div.row{
    display:table-row;
}  
</style>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body style='background-color:lightgreen'>
<div style='width:1100px;margin:auto'>
  <br> <h1 align="center">Product of Two Numbers in JQuery</h2>
<font face="arial" size='5'>
<div class="row"><label>    Enter First Value  </label> &nbsp;&nbsp;
<input style="font-size:20px; font-family:arial; color:magenta" type="text" name="val1"
  id="val1" autofocus maxlength="10" size="5">  </div>
  <div class="row"><label>  Enter Second Value </label> &nbsp;&nbsp;
<input style="font-size:20px; font-family:arial; color:magenta" type="text" name="val2"
  id="val2" autofocus maxlength="10" size="5"> </div>
</font><br>
<br> <input id="button1" type="button" name="button"
 title="Click here to find the product of two numbers." value="Find Product">
<input id="button2" type="button" name="button" 
title="Click here to clear the text boxes." value="Clear">
 <br><br><br>
<div id="display" style="height: 50px; width: 100%;"></div>
<script type="text/javascript">
 $(document).ready(function(){
    $('#button1').click(function(){
          a =document.getElementById("val1").value;
 b =document.getElementById("val2").value;
 product = a*b;
 message = "The product of " + a + " and " + b + " is " + product + ".";
      display.innerHTML= message;
   
    });
$('#button2').click(function(){
          document.getElementById("val1").value="";
 document.getElementById("val2").value="";
 display.innerHTML="";
         document.getElementById("val1").focus();
  });
});
 </script>
</body>
</html> 


Enter Keypress Using JQuery

In this sample code will show you how to use enter key press using  Jquery Javascript library framework our program will ask the user to enter their name and then the user press the enter key and then our program will greet our user.


 If you like my work please send me an email at  jakerpomperada@gmail.com and jakerpomperada@yahoo.com

People here in the Philippines who wish to contact me can call and text me in this number 09173084360. 

Thank you very much and God Bless.



Sample Program Output

Program Listing

<!-- Enter Keypress in JQuery              -->
<!-- April 10, 2015  Friday                     -->
<!-- Written By: Mr. Jake R. Pomperada, MAED-IT -->
<!-- JQuery Version                             -->
<html>
<title>Enter Keypress in JQuery </title>
<script src="jquery.js"></script>
<style>
h2 {
    font-family:arial;
};
</style>
<script>
 function clear_me() {
    document.getElementById("me").value="";
document.getElementById("display").value="";
display.innerHTML ="";
document.getElementById("me").focus();
}
</script>
<body bgcolor="lightgreen">
<br>
<h2 align="center"> Enter Keypress in JQuery
</h2>
<font face="arial" size='5'>
What is your name : ? &nbsp;
<input style="font-size:20px; font-family:arial; color:magenta" type="text" name="me"
  id="me" utofocus>
<br><br>
<button onclick="clear_me();" title="Click here to clear textbox.">
Clear Text Box</button> <br><br><br>
<div id="display" style="height: 50px; width: 100%;"></div>
</font>
<script>
var display=document.getElementById("display");

 $('#me').keypress(function(e) {
if (e.which == 13) {
      message = "Hello " + "<span style='color: red'>"+
 document.getElementById("me").value + "</span> "+ " How are you? Welcome To JQuery Programming " ;
      display.innerHTML= message;
 
}
});
</script>
</body>
</html>



Enter Keypress in JavaScript

 In this sample code will show you how to use enter key press using Javascript our program will ask the user to enter their name and then the user press the enter key and then our program will greet our user.


 If you like my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com

People here in the Philippines who wish to contact me can call and text me in this number 09173084360. 

Thank you very much and God Bless.



Sample Program Output


Program Listing


<!-- Enter Keypress in JavaScript                              -->
<!-- April 10, 2015  Friday                                            -->
<!-- Written By: Mr. Jake R. Pomperada, MAED-IT   -->
<!-- JavaScript                                                              -->
<html>
<style>
h2 {
    font-family:arial;
};
</style>
<script>
function get_name(e) {
       var display=document.getElementById("display");
if (e.keyCode==13){
  message = "Hello " + "<span style='color: red'>"+
  document.getElementById("me").value + "</span> "+ " How are you? " ;
       display.innerHTML= message;
  } 
       
}
 function clear_me() {
    document.getElementById("me").value="";
document.getElementById("display").value="";
display.innerHTML ="";
document.getElementById("me").focus();
}

</script>
<body bgcolor="lightgreen">
<br>
<h2 align="center"> Enter Keypress in Javascript
</h2>
<font face="arial" size='5'>
What is your name : ? &nbsp;
<input style="font-size:20px; font-family:arial; color:blue" type="text" name="me"
  id="me" onkeypress="get_name(event)" autofocus>
<br><br>
<button onclick="clear_me();" title="Click here to clear textbox.">
Clear Text Box</button> <br><br><br>
<div id="display" style="height: 50px; width: 100%;"></div>
</font>
</body>
</html>


Wednesday, April 8, 2015

Class in PHP

In this short code that I wrote it will show you how to create a class in PHP and how to create an object based on the class that we have written. This code will give you a first hand experience how to write a code in PHP using Object Ortiend Approach in programming.

If you like my work please send me an email at jakerpomperada@gmail.com andjakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can call and text me in this number 09173084360.

Thank you very much and God Bless.




Sample Program Output


Program Listing

<?php

class message {

 public $Name ="John Doe";
 public $Age = 56;
 public $Address = "Washington Street, USA";
 public $Work ="Janitor";
 }

  $info = new message;

 echo "<font size='5'>";
 echo "Name     : ".$info->Name."<br>";
 echo "Age      : ".$info->Age."<br>";
 echo "Address  : ".$info->Address."<br>";
 echo "Work     : ".$info->Work."<br>"; 
 echo "</font>";

 ?>

Number System Converter in Visual Basic .NET

In this article I would like to share with you a sample program that I wrote while I'm still learning how to program in Visual Basic .NET I called this program Number System Converter 1.0 in Visual Basic .NET.  What does our program do is very simple it will ask the user to enter a value in Octal and then it will convert in Decimal, Hexadecimal and Binary Number equivalent.

If you like my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can call and text me in this number 09173084360.

Thank you very much and God Bless.



Sample Program Output




Word Counter in JavaScript

Here is a sample program that I wrote will count the number of words in a given sentence by our user using JavaScript as our programming language. The code is very simple and easy to understand I intended my work for beginners that are new in JavaScript programming.

If you like my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contract me through my mobile number can reach me in this number 09173084360.

Thank you very much and God Bless.





Program Listing

<html>
<title>Word Counter in Javascript</title>
<style>
body { 
  font-size:20px; 
  font-family:arial;
  color:blue;
  } 

input {
  display: table-cell;
}
   div.justified {
        display: flex;
        justify-content: center;
    }
</style>
<script language="JavaScript">
function count_words()
  {
  var words_count =document.getElementById("sentence").value.split(' ').length;;
  document.getElementById("word").value= words_count;
 }      
 
  
   function clear_me() {
    document.getElementById("sentence").value="";
document.getElementById("word").value="";
document.getElementById("sentence").focus();
}
  </script>
<body style='background-color:lightgreen'>
<div style='width:1100px;margin:auto'>
  <br> <h1 align="center">Words Counter in Javascript</h2>
  <div class="justified">
<textarea name="sentence"  id="sentence" cols="80" rows="5" autofocus></textarea>
<br /> </div>
 <br><center> <button onclick="count_words();" 
 title="Click here to find the number of words in a sentence.">
 Count Number of Words</button>
 <button onclick="clear_me();" title="Click here to clear text fields.">
Clear</button>  </center>
 <br> <br>
 <div class="justified"><label>  The number of words in a sentence is <input id="word"  size="5" readonly> . </label>   <br> </div>
  </body>
</html>


Lowercase and Digits Counter in PHP

In this article I would like to share a program that I wrote that will allows the user to count the number of occurrence of lowercase letters and digits in a given sentence using PHP as our programming language. What does the program will do is to ask the user to enter a word or a sentence and then our program will count how many times the lowercase letters and digits occurs in a given word or sentence.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com. My mobile number here in the Philippines is 09173084360.


Thank you very much and God Bless.




Program Listing

<html>
<title> Lowercase Letters and Digits Counter</title>
<style>
body { 
  font-size:20px; 
  font-family:arial;
  color:blue;
  } 
</style>
<?php
error_reporting(0);

$values = $_POST['value'];

// function to count the number of lowercase letters
// in a given word or sentence.

function lowercase_letters($string) {
   return strlen(preg_replace("/[^a-z]/","", $string));
}
// function to count the number of digits in a given
// word or sentence.

function count_digits($string) {
  return count(preg_grep('~^[0-9]$~', str_split($string)));
}
  
if(isset($_POST['check'])) {

  if ($values==" ") {
      echo "<script>";  
  echo "alert('It Cannot Be Empty!!! Please enter a number.');";
  echo "</script>";
  $values=" ";
  $results=" ";
     }

 if ($values != " ") {

   $results .=  "==== REPORT ==== ";
   $results .=  "<br><br>";
   $results .= "The sentence or the word is "
            ."<font color='RED'>".$values."</font>"."."
."<br><br>";
   $results .= "The number of capital letters is "
                ."<font color='RED'>".lowercase_letters($values)."</font> ".
" in a given word or sentence."."<br><br>";
$results .= "The number of digits is "
                ."<font color='RED'>".count_digits($values)."</font> ".
" in a given word or sentence.";
   }
 }
      
 
if(isset($_POST['clear'])) {
  $values=" "; 
  $results= " ";
  
}

?>
<body style='background-color:lightgreen'>
<div style='width:900px;margin:auto'>
  <br> <h1 align="center">Lowercase Letters and Digits Counter </h2>
  <br>
<form action="" method="post">
 Enter a Word or a Sentence : <input type="text" name="value"    value="<?php echo $values; ?>" autofocus  size=80/>
 <br><br>
   <input type="submit" name="check" value="Lowercase Letters and Digits Counter" 
  title="Click here to count the number of lowercase letters and digits in a given word or sentence."/>
  <input type="submit" name="clear" value="Clear" 
  title="Click here to clear text box and values on the screen"/>
</form>
<br>
<?php 
echo $results;
 ?>
  </body>
</html>