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

Bucket Sorting in Java

I wrote this program ten years ago while I am learning Java programming I called this program Bucket Sorting 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.
 
 
 
 
Sample Program Output
 

Program Listing

buck.java

// buck.java
// Author  : Mr. Jake Rodriguez Pomperada,MAED - Instructional Techonology
// Tool    : Java
// Date    : March 18, 2009 Tuesday 1:45 PM
// Email   : jakerpomperada@yahoo.com
// Tel. No.: +63 034 4335081
// Program Description:
// Bucket Sort Program in Java Implementation


import java.io.*;

class buck    {

    static void printArray(int[] b)
        {
        for (int i = 1; i < b.length; i++) System.out.print(" " + b[i]);
        System.out.print("\n");
      }


// Bucket Sort Sorting Code

       public static void bucketSort(int entry[],int m){
                int[] buckets = new int[m];

                for(int j=0;j<m;j++)
            buckets[j]=0;
                for(int i=0;i<entry.length;i++)
                        ++buckets[entry[i]];
                for(int i=0,j=0;j<m;++j)
            for(int k=buckets[j];k>0;k--)
                                entry[i++]=j;
    }

  // End of Method

  public static void main (String args []) throws IOException    
       {
       String get_value;
        int n_value=0;
  
    String strEntry;
        int i=0;

        int entry[] = new int[6];
        BufferedReader dataIn= new BufferedReader(new InputStreamReader(System.in));
        System.out.println();
        System.out.print("\t============================================\n");
        System.out.print("\t========   Bucket Sort Version 1.0  ========\n");
        System.out.print("\t===== By: Mr. Jake Rodriguez Pomperada =====\n");
        System.out.print("\t============================================\n");
       

        System.out.println();

   
        for( i =1 ; i < entry.length; i++)
            {
            System.out.print("Enter number No. " + i +" : ");
            strEntry = dataIn.readLine();
            entry[i] = Integer.parseInt(strEntry);
        }
        System.out.println();
        System.out.println("== Original numbers ==>");
        printArray(entry);
     
          bucketSort(entry,50000);
        System.out.println("\n");
        System.out.println("== Sorted numbers ==>");
        printArray(entry);
        System.out.println("\n");
        System.out.print("\t====================================================\n");
        System.out.print("\t=== Created By: Jake Rodriguez Pomperada,MAED-IT ===\n");
        System.out.print("\t====================================================\n");
    }

} // End of Code


Saturday, December 14, 2019

Product of Two Numbers Using Function in Pascal

I wrote this program using Pascal to ask the user to give two numbers and then the program will compute the product of two given numbers using functions in Pascal. I am using Free Pascal as my Pascal compiler in writing this program. Free Pascal can be downloaded free from the charge on the Internet.

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

product.pas

Program Product;
Uses Crt;

Var x,y,display : integer;

Function Multiply(a,b : integer) : integer;

Begin
  Multiply := (a*b);
End;


Begin
   Clrscr;
   x :=0;
   y:=0;
   Writeln;
   Write('Product of Two Numbers Using Function in Pascal');
   Writeln;
   Writeln;
   Write('Enter First Value  :  ');
   Readln(x);
   Write('Enter Second Value :  ');
   Readln(y);

   display := Multiply(x,y);

   Writeln;
   Write('The product of ',x, ' and ',y,' is ',display,'.');
   Writeln;
   Writeln;
   Write('End of Program');
   Readln;
End.






Friday, December 13, 2019

Basic Computer Website Template

I wrote this basic compute website template to my class before in web design and development using HTML, CSS, and JavaScript.

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