Tuesday, December 17, 2019

Square a Number in PHP

I wrote this simple program to ask the user to give a number and then the program will square the given number and display the results on the screen using PHP as my 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.

Thank you very much for your help and support.


Sample Program Output


Program Listing

index.php

<html>
    <head>
    <title> Square a Number in PHP </title>
    </head>
    <body>
      <h2> Square a Number in PHP </h2><br>

      <form method ="post">
        Give a Number <input type ="text" name="num"/> <br>
        <button type="submit" title="Click here to compute square value">
         Compute </button>
         </form>
         </body>
         </html>

         <?php
             
               if ($_POST) {

                   $num = $_POST['num'];

                   $compute = ($num * $num);

                   echo "The square value of $num is $compute.";
               }
             ?>
             
        
     



String and Number Palindrome in PHP

String and Number Palindrome in PHP

I wrote this program using PHP programming that will ask the user to give a string or number and then the program will check if the given number or string is a palindrome or not a palindrome.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.

Thank you very much for your help and support.



Sample Program Output


Program Listing

index.php

<html>
   <head> 
   <title> Palindrome Checker in PHP </title>
   </head>
    <body>
       <h2> Palindrome Checker in PHP </h2>
       <br>
          <form method="post">
           Give a String or a Number <input type="text" name="num"/>
           <br>
           <button type="submit">Check Palindrome </button>
           </form>
       </body>
       </html>

       <?php
          if ($_POST) {
              $num = $_POST['num'];

              $reverse = strrev($num);

              if ($num == $reverse) {
                  echo "The given string/number $num is a Palindrome.";
              } else {
                echo "The given string/number $num is Not a Palindrome.";
              }
          }    
?>


Addition of Five Numbers in PHP

Addition of Five Numbers in PHP

I wrote this program to ask the user to give five numbers and then the program will compute the total sum of five numbers using HTML forms in PHP programming.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.

Thank you very much for your help and support.



Sample Program Output



Program Listing

index.php


<html>
   <head>
      <title> Addition of Five Numbers in PHP</title>
    </head>
     <body>
         <h2> Addition of Five Numbers in PHP </h2>
         <br>
<form method="post">
    Give First Value  <input type="number" name="num1"/> <br>
    Give Second Value  <input type="number" name="num2"/> <br>
    Give Third Value  <input type="number" name="num3"/> <br>
    Give Fourth Value  <input type="number" name="num4"/> <br>
    Give Fifth Value  <input type="number" name="num5"/> <br><br>
    <button type="submit" title="Click to solve the sum."> Solve </button>
      </form>
  </body>
  </html>

  <?php
   
      if ($_POST)
      {
          $num1 = $_POST['num1'];
          $num2 = $_POST['num2'];
          $num3= $_POST['num3'];
          $num4 = $_POST['num4'];
          $num5 = $_POST['num5'];

          $sum = ($num1 + $num2 + $num3 + $num4 + $num5);

          echo "The sum of $num1, $num2, $num3, $num4 and $num5 is $sum.";
      }  

?>



Ben Tulfo: "Bacolod Coun. Espino! Tago ka sa palda ng GF mo!"

Monday, December 16, 2019

Diamond Pattern Generator in Java

I wrote this simple diamond pattern generator using the Java Programming language. It will ask the user how many rows and then the program will generate the diamond pattern based on the given rows 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.

Thank you very much for your help and support.



Sample Program Output

 
Program Listing

diamond_pattern.java

package diamond;

import java.util.Scanner;

public class diamond_pattern {
public static void main(String args[])
{
int n, i, j, space = 1;
System.out.print("\n\n");
System.out.print("\tDiamond Pattern Generator in Java ");
System.out.print("\n\n");
System.out.print("\tGive number of rows: ");
Scanner s = new Scanner(System.in);
n = s.nextInt();
space = n - 1;
for (j = 1; j<= n; j++)
{
for (i = 1; i<= space; i++)
{
System.out.print(" ");
}
space--;
for (i = 1; i <= 2 * j - 1; i++)
{
System.out.print("*");
}
System.out.println("");
}
space = 1;
for (j = 1; j<= n - 1; j++)
{
for (i = 1; i<= space; i++)
{
System.out.print(" ");
}
space++;
for (i = 1; i<= 2 * (n - j) - 1; i++)
{
System.out.print("*");
}
System.out.println("");
}
System.out.print("\n");
System.out.print("\tEnd of Program");
System.out.print("\n");
}
}

Sunday, December 15, 2019

Creating a Constants in Java

I wrote this simple program to show how to create constants in Java 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.

Thank you very much for your help and support.
 
 
Sample Program Output


Program Listing
 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication1;

/**
 *
 * @author Jake R. Pomperada, MAED-IT
 * December 15, 2019  Sunday  9:32 PM
 * Eroreco Subdivision, Barangay Mandalagan 6100 Bacolod City
 * Negros Occidental, Philippines
 * Netbeans IDE 6.5
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        final int TWOPOINTS = 2;
        final int THREEPOINTS = 3;

        System.out.print("\n");
        System.out.print("\tCreating a Constants in Java");
        int no_of_twopoints = 5 * TWOPOINTS;
        int no_of_threepoints = 8 * THREEPOINTS;

       System.out.println("\n");
       System.out.println("\tTotal Score of Two Points : " + no_of_twopoints);
       System.out.println("\tTotal Score of Three Points : " + no_of_threepoints);
        System.out.print("\n");
        System.out.print("\tEnd of Program");
        System.out.print("\n\n");
    }

}
 

Creating a Variable in Java

In this article I will share with you guys a sample program how to create a variable using Java as our 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.

Thank you very much for your help and support.
 
 
 
Sample Program Output
 
 
 
Program Listing
 
 /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication1;

/**
 *
 * @author Jake R. Pomperada, MAED-IT
 * December 15, 2019  Sunday  8:54 PM
 * Eroreco Subdivision, Barangay Mandalagan 6100 Bacolod City
 * Negros Occidental, Philippines
 * Netbeans IDE 6.5
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.print("\n");
        System.out.print("\tCreating a Variable in Java");
        System.out.println("\n");
        String message = "\tThis is an initial value of the variable";
        System.out.print(message);
        System.out.println("\n");
        message ="\tThis is an Modified Value of the variable.";
        System.out.print(message);
        System.out.print("\n\n");
        System.out.print("\tEnd of Program");
        System.out.print("\n\n");
    }

}

Quick Sort Program in C

A simple quick sort program that I wrote a long time ago using C 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.

Thank you very much for your help and support.
 
 
 
 
Sample Program Output
 

Program Listing 
 
quick.c
 
#include <stdio.h>
#include <conio.h>


#define maxsize 100

int A[maxsize];

void quicksort(int a, int b)
{
  int rtidx=0,ltidx=0,k=a,l=0,pivot;
  int leftarr[maxsize],rtarr[maxsize];
  pivot=A[a];
  if(a==b)return;
  while(k<b)
  {
    ++k;
     if(A[k]<A[a])
     {
      leftarr[ltidx]=A[k];
      ltidx++;
      }
        else
        {
        rtarr[rtidx]=A[k];
        rtidx++;
         }
          }

     k=a;
     for(l=0;l<ltidx;++l)A[k++]=leftarr[l];
     A[k++]=pivot;
     for(l=0;l<rtidx;++l)A[k++]=rtarr[l];
     if(ltidx>0)quicksort(a,a+ltidx-1);
     if(rtidx>0)quicksort(b-rtidx+1,b);
     }

void printarr(int a)
{
  int i;
  for(i=0;i<a;i++)
  {
  printf(" %d ",A[i]);
  }
  }

main()
{
  int i=0,s=0;
  clrscr();
  printf("\n======================================================");
  printf("\n\t QUICK SORT USING C VERSION 1.0");
  printf("\n Created By: Mr. Jake Rodriguez Pomperada, MAED-IT");
  printf("\n======================================================");
  printf("\n\n");
  printf("How many numbers to process :=> ");
  scanf("%d",&s);
  for(i=0;i<s;i++)
  {
     printf("Enter value No. %d :=> ",i+1);
     scanf("%d",&A[i]);
     }
  printf("\n==========================");
  printf("\n\t  RESULTS ");
  printf("\n==========================");
  printf("\n");
  printf("The Values before sorting ");
  printf("\n");
  printarr(s);
  quicksort(0,s-1);
  printf("\n\n");
  printf("The Values after sorting");
  printf("\n");
  printarr(s);
  getche();
  }
 

Month Calendar Generator in Java

I wrote this program to generate month calendar using Java programming ten years ago while learning how to program in Java.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/

If you like my video tutorials kindly click the like button and subscribe for more video tutorials on my channel.

Thank you very much for your help and support.
 
 
 
 
 
Program Listing
 
calendar.java
 

// calendar.java
// author  : Mr. Jake Rodriguez Pomperada, MAED - Instructional Technology
// date    : March 18, 2009 Tuesday 2:05 PM
// tool    : Java
// email   : jakerpomperada@yahoo.com
// tel. no.: +63 034 4335081
//
// program description:
//
// Argument Month and Day Calendar in Java implementation




import java.util.*;

class calendar
{
        public static void main(String arg[])
        {
              GregorianCalendar c1 = new GregorianCalendar();
              int month  = Integer.parseInt(arg[0]);
              int year = Integer.parseInt(arg[1]);
              month = month-1;
              c1.set(year,month,1);
              int day = c1.get(Calendar.DAY_OF_WEEK);
              System.out.println(day);
              int numdays = 0;

        switch(c1.get(Calendar.MONTH))
        {
           case 0:
           case 2:
           case 4:
           case 6:
           case 7:
           case 9:
           case 11:
                numdays = 31;

                break;
           case 1:
                if(c1.isLeapYear(c1.get(Calendar.YEAR)))
                   numdays = 29;
                else
                   numdays = 28;
                   break;
           case 3:
           case 5:
           case 8:
           case 10:
                 numdays = 30;
                 break;
        default:
                System.out.println("ERROR IN MONTH SPECIFICATION");
                break;
       }
       display(day,numdays);

       }
       static void display(int sday , int tday)
         {
              int k = 0;

              System.out.print("\n\n");
              System.out.print("\n=========================================");
               System.out.print("\n    MONTH AND YEAR CALENDAR VERSION 1.0");
              System.out.print("\n=========================================");

              System.out.print("\n\n");
              System.out.println(" SUN  MON  TUE  WED  THU  FRI  SAT ");
              for(int j = 1;j <= sday-1; j++)
              {
               System.out.print("     ");
               k++;
              }
             for(int i = 1;i <= tday;i++)
             {
               if(i < 10)
                System.out.print("  "+"0"+i+" ");
               else
                System.out.print("  "+i+" ");
               k++;
               if ( k == 7)
               {
                System.out.println();
                k = 0;
               }
             }
             System.out.print("\n\n");
              System.out.print("\n==================================================");
                 System.out.print("\n   Created By: Mr. Jake R. Pomperada, MAED-IT    ");
              System.out.print("\n==================================================");

           System.out.print("\n\n");

          System.exit(1);

      }
 }  // End of Code