Wednesday, September 13, 2017

Quick Sort in Java Version 2

Here is the implementation of quick sort version 2 using Java as my programming language. Our program will ask the user how many items to be sorted and then it will ask the user to give a series of numbers and then it will be sorted using selection sort algorithm. I hope you will find my work useful. 


I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing

/**
 * 
 */
package quick_sort;

import java.util.Scanner;

/**
 * @author Jake R. Pomperada
 * Bacolod City, Negros Occidental, Philippines
 * September 13, 2017   Wednesday
*/


public class Quick_Sort_Demo {

/**
* @param args
*/
public static void Quick_Sort_All(int[] arr)
    {
        Quick_Sorting(arr, 0, arr.length - 1);
    }
    
    public static void Quick_Sorting(int arr[], int low, int high) 
    {
        int i = low, j = high;
        int temp;
        int pivot = arr[(low + high) / 2];

        
        while (i <= j) 
        {
            while (arr[i] < pivot)
                i++;
            while (arr[j] > pivot)
                j--;
            if (i <= j) 
            {
                /** swap **/
                temp = arr[i];
                arr[i] = arr[j];
                arr[j] = temp;

                i++;
                j--;
            }
        }

        
        if (low < j)
        Quick_Sorting(arr, low, j);
        
        if (i < high)
        Quick_Sorting(arr, i, high);
    }
public static void main(String[] args) {
// TODO Auto-generated method stub
       Scanner input = new Scanner(System.in);
      
System.out.print("\n\n");
System.out.print("===== Quick Sort in Java ====");
System.out.print("\n\n");
System.out.print("===== Written By: Mr. Jake R. Pomperada =====");;
System.out.print("\n\n");
System.out.print("How many items? : ");
        int num = input.nextInt();
        int numbers[] = new int[num];

System.out.println();
        for (int i = 0; i < num; i++) {
            System.out.print ("Give value in item no. " + (i+1) + " : ");
            numbers[i] = input.nextInt();
        }

        System.out.print("\n\n");
System.out.print("Original Number Arrangements" );
System.out.print("\n\n");
        for (int temp : numbers){
        System.out.print(temp);
            System.out.print(", ");
        } 
        System.out.print("\n\n");
System.out.print("Sorted Number Arrangements" );
System.out.print("\n\n");
        
        
        Quick_Sort_All(numbers);
        for(int a:numbers){
            System.out.print(a);
            System.out.print(", ");
}
        input.close();

}

}





Tuesday, September 12, 2017

Insertion Sort in Java

Here is the implementation of insertion sort using Java as my programming language. Our program will ask the user how many items to be sorted and then it will ask the user to give a series of numbers and then it will be sorted using selection sort algorithm. I hope you will find my work useful. 


I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

Insertion_Sorting.java

/**
 * 
 */
package insertion_sort;

import java.util.Scanner;

/**
 * @author Jake R. Pomperada
 * Bacolod City, Negros Occidental, Philippines
 * September 12, 2017   Tuesday
*/

public class Insertion_Sorting {

/**
* @param args
*/
public static int[] Insertion_Sorting_Test(int[] input){
         
       int temp;
       for (int i = 1; i < input.length; i++) {
           for(int j = i ; j > 0 ; j--){
               if(input[j] < input[j-1]){
                   temp = input[j];
                   input[j] = input[j-1];
                   input[j-1] = temp;
               }
           }
       }
       return input;
   }
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.print("\n\n");
System.out.print("===== Insertion Sort in Java ====");
System.out.print("\n\n");
System.out.print("===== Written By: Mr. Jake R. Pomperada =====");;
System.out.print("\n\n");
System.out.print("How many items? : ");
        int num = input.nextInt();
        int numbers[] = new int[num];

System.out.println();
        for (int i = 0; i < num; i++) {
            System.out.print ("Give value in item no. " + (i+1) + " : ");
            numbers[i] = input.nextInt();
        }

        System.out.print("\n\n");
System.out.print("Original Number Arrangements" );
System.out.print("\n\n");
        for (int temp : numbers){
        System.out.print(temp);
            System.out.print(", ");
        } 
                System.out.print("\n\n");
System.out.print("Sorted Number Arrangements" );
System.out.print("\n\n");
        
        
        int[] process_array = Insertion_Sorting_Test(numbers);
        for(int a:process_array){
            System.out.print(a);
            System.out.print(", ");
}
        input.close();
}

}


Selection Sort in Java

Here is the implementation of selection sort using Java as my programming language. Our program will ask the user how many items to be sorted and then it will ask the user to give a series of numbers and then it will be sorted using selection sort algorithm. I hope you will find my work useful. 

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Sample Program Output


Program Listing

Selection_Sort.java

/**
 * 
 */
package selection_sorting;

import java.util.Scanner;


/**
 * @author Jake R. Pomperada
 * Bacolod City, Negros Occidental, Philippines
 * September 12, 2017   Tuesday
 */


public class Selection_Sort {

/**
* @param args
*/
public static int[] Selection_Sorting(int[] arr){
        
        for (int i = 0; i < arr.length - 1; i++)
        {
            int index = i;
            for (int j = i + 1; j < arr.length; j++)
                if (arr[j] < arr[index]) 
                    index = j;
      
            int smallerNumber = arr[index];  
            arr[index] = arr[i];
            arr[i] = smallerNumber;
        }
        return arr;
    }
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.print("\n\n");
System.out.print("===== Selection Sort in Java ====");
System.out.print("\n\n");
System.out.print("===== Written By: Mr. Jake R. Pomperada =====");;
System.out.print("\n\n");
System.out.print("How many items? : ");
        int num = input.nextInt();
        int numbers[] = new int[num];

System.out.println();
        for (int i = 0; i < num; i++) {
            System.out.print ("Give value in item no. " + (i+1) + " : ");
            numbers[i] = input.nextInt();
        }

        System.out.print("\n\n");
System.out.print("Original Number Arrangements" );
System.out.print("\n\n");
        for (int temp : numbers){
        System.out.print(temp);
            System.out.print(", ");
        } 
        
        System.out.print("\n\n");
System.out.print("Sorted Number Arrangements" );
System.out.print("\n\n");
        
        int[] process_array = Selection_Sorting(numbers);
        for(int a:process_array){
            System.out.print(a);
            System.out.print(", ");
}

        input.close();
}
}





Largest of Three Numbers in Java

In this article I would like to share with you a simple program that I wrote using Java to ask the user to give three numbers and then our program will determine which of the three numbers is the biggest or largest in terms of numerical value.  The code is very simple and easy to understand.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Sample Program Output


Program Listing


Largest_Three_Numbers.java


/**
 * 
 */
package largest_three;

import java.util.Scanner;

/**
 * @author Jake R. Pomperada
 * Bacolod City, Negros Occidental, Philippines
 * September 12, 2017   Tuesday
 */

public class Largest_Three_Numbers {

/**
* @param args
*/

public static void largest_three_values(int a, int b, int c)
{
if (a >= b && a >= c) {
System.out.print("\n\n");
System.out.print("The Largest Number is " + a + "." );
System.out.print("\n\n");
System.out.print("End of Program");
}
if (b >= a  && b >= c) {
System.out.print("\n\n");
System.out.print("The Largest Number is " + b + "." );
System.out.print("\n\n");
System.out.print("End of Program");
}
if (c >= a  && c >= a) {
   System.out.print("\n\n");
System.out.print("The Largest Number is " + c + "." );
System.out.print("\n\n");
System.out.print("End of Program");
}
}

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);

int val1=0;
int val2=0;
int val3=0;
System.out.print("\n\n");
System.out.print("===== Largest of Three Numbers in Java ====");
System.out.print("\n\n");
System.out.print("===== Written By: Mr. Jake R. Pomperada =====");;
System.out.print("\n\n");
System.out.print("Enter Three Numbers : ");
val1=input.nextInt();
val2=input.nextInt();
val3=input.nextInt();
largest_three_values(val1,val2,val3);
input.close();
}

}





Mathematics Tutorial Services in Bacolod City


Having problems following through classroom lectures in mathematics and science and appreciating mathematics and science at its basics? Do you need assistance in coping with the inherent challenges encountered with these subjects? You might just be in need of a follow up, or some more practice in solving problems in these areas. Then a one-on-one or guided practice might be the one for you. 
Mathematics is all about procedures and pattern(s) recognition in solving. If these procedures and patterns are understood, any mathematical procedure no matter how complex is made a lot easier and manageable as they may first appear at first reading. Scientific problems on the other hand need mathematical skills in applying the given information in the problem to appropriate formulas together with information like what is given and what is required in the problem.
Dr. Ma. Junallie F. Pomperada is a professor of the College of Engineering of the University of St. La Salle in the Chemical Engineering Department. Graduated from University of Negros Occidental-Recoletos and finished her Master of Engineering Major in Chemical Engineering from Central Philippine University. She finished her Doctor of Philosophy in Technology Management from Carlos Hilado Memorial State College.

Tutorial Services Offered:
Inorganic Chemistry, Analytical Chemistry, Thermodynamics, Algebra, Trigonometry, Differential and Integral Calculus, Differential Equations, Advanced Engineering Mathematics, Chemical Reaction Engineering, Process Control ad Unit Operations with Specialization in Distillation, Evaporation, Gas Absorption, Stripping, Extraction and Leaching.
She caters high school and college students who are is need proper guidance and direction in mathematics subjects. Her tutorial hourly rate's are very affordable it will discuss before the tutorial session.
Available time tutorial schedule will be on Saturday and Sunday only.

Big discounts for a group of students who will avail of her tutorial services.
For more information kindly contact her in her mobile number 0917 - 701 - 0825.
Email address :  mjefpomperada@yahoo.com.ph
Home Telephone Number : 433  - 5675

Facebook Address: https://www.facebook.com/allie.fuentebella






Sunday, September 10, 2017

Sum of Four Numbers Using Methods in Java


In this article I would like to share with you guys a simple program to ask the user to give four numbers and then our program will compute it's sum using a method in Java. The code is very simple and easy to understand for people that are very new in Java programming I hope you will find my work useful. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


Program Listing

/**
 * 
 */
package addition_four_numbers;

import java.util.Scanner;


/**
 * @author Jake Rodriguez Pomperada, MAED-IT
 * Location : Bacolod City, Negros Occidental Philippines.
 * Date     : September 10, 2017  Sunday  12:13 PM
 */
public class Addition_Four_Numbers {

public static int total_sum(int a,int b, int c, int d)
{
int find_sum=0;
find_sum = (a+b+c+d);
System.out.print("\n\n");
System.out.print("The total sum is  " + find_sum + ".");
return find_sum;
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);

int val1=0;
int val2=0;
int val3=0;
int val4=0;
System.out.print("\n\n");
System.out.print("===== Sum of Four Numbers Using Methods in Java ====");
System.out.print("\n\n");
System.out.print("===== Written By: Mr. Jake R. Pomperada =====");;
System.out.print("\n\n");
System.out.print("Enter First Number : ");
val1=input.nextInt();
System.out.print("Enter Second Number : ");
val2=input.nextInt();
System.out.print("Enter Third Number : ");
val3=input.nextInt();
System.out.print("Enter Fourth Number : ");
val4=input.nextInt();
total_sum(val1,val2,val3,val4);
input.close();

}

}



Sunday, September 3, 2017

Maximum Value Checker in Java

A very simple program that I wrote that will check and determine which of the given list of numbers in our array is the maximum or the biggest in terms of numerical value using Java as my programming language.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing


Maximum_values.java


/**
 * 
 */
package array_demo;

/**
 * @author Jacob F. Pomperada
 * September 3, 2017  Sunday
 * Mandaluyong City, Metro Manila
 *
 */
public class Maximum_values {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int b[] = {100,35,567,5,62};
int max_value=0;
for (int a=0; a<5; a++)
{
if (b[a] > max_value)
{
max_value=b[a];
}
}

 System.out.println();
       System.out.println("Maximum Value Checker in Java");
       System.out.println();
       System.out.println("Written By Mr. Jake R. Pomperada, MAED-IT");
       System.out.println();
        System.out.print("The Maximum value in the array is " + max_value + ".");
System.out.println("\n\n");
       System.out.println("End of Program");
       System.out.println();

}

}