Categories
Java

Primer Number Generator in Java

I wrote this program to ask the user to give a number and then the program will list down the prime numbers on the screen using 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, web development using WordPress, Computer 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/

Sample Program Output
My video tutorial in my YouTube channel.

Program Listing

Prime_Number_Generator.java

import java.util.Scanner;

// Written By Jake R.Pomperada,MAED-IT
// January 4, 2020   Saturday
// jakerpomperada@gmail.com
// Bacolod City, Negros Occidental Philippines

public class Prime_Number_Generator {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner Input = new Scanner(System.in);
		
		System.out.println();
		System.out.println("\tPrimer Number Generator in Java");
		System.out.println();
		System.out.print("\tGive a Number : ");
		int num = Input.nextInt();
		System.out.println("\n");
		System.out.print("\tList of Prime Numbers");
		System.out.println("\n");
		System.out.print("\t");
		for (int i = 2; i <= num; i++){
			if (IsPrime(i)){
				System.out.print(i+" ");
			}
		}
	}

	private static boolean IsPrime(int num) {
		boolean flag = true;
		
		for (int i=2; i<num/2; i++){
			if (num % i == 0){
				flag = false;
				break;
			}
		}
		return flag;
	}
	
}
Categories
Java

String Inputs in Java

I wrote this program to show you how to accept a string and display the given string in the screen 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, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.


My personal website is http://www.jakerpomperada.comMy 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/

Sample program output
My video tutorial on my YouTube channel.

Program Listing

String_Input .java

import java.util.Scanner;


public class String_Input {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner input = new Scanner(System.in);
		
		String name,address, email;
		
		System.out.println("\n");
		System.out.print("\tString Inputs in Java");
		System.out.println("\n");
		System.out.print("\tEnter Your Name    : ");
		name =input.nextLine();
		System.out.print("\tEnter Your Address : ");
		address =input.nextLine();
		System.out.print("\tEnter Your Email   : ");
		email =input.nextLine();
		System.out.println();
		System.out.print("\tDISPLAY RESULTS");
		System.out.println("\n");
		System.out.print("\tName    : " + name +"\n");
		System.out.print("\tAddress : " + address +"\n");
		System.out.print("\tEmail   : " + email +"\n");
		System.out.println();
		System.out.print("\tEnd of the Program");
		System.out.println();
	}

}
Categories
Java

List of Alphabets in Java

Here is a sample program to display the alphabets on the screen using 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, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.


My personal website is http://www.jakerpomperada.comMy 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/

Sample Program Output



My video tutorial on my YouTube Channel




Program Listing

Alphabets_Example.java

public class Alphabets_Example {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
      System.out.println("\n");
      System.out.println("\tList of Alphabets in Java");
      System.out.println("\n");
      
      for (char ch='A'; ch<='Z'; ch++) {
    	  System.out.print(" " + ch + " ");
      }
      
      System.out.println("\n");
      System.out.println("\tEnd of Program");
	}

}
Categories
Java

Average of Three Numbers in Java

I wrote this simple program to ask the user to give three numbers and then the program will compute the average of the three given numbers using 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, web development using WordPress, Computer 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/

Sample Program Output


My video tutorial in my YouTube Channel

Program Listing

average_value.java

import java.util.Scanner;

public class average_value {

/**
 * @param args
 */
public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner input = new Scanner(System.in);

    int a=0,b=0,c=0;
    int sum=0,average=0;

    System.out.println("\n");
    System.out.println("\tAverage of Three Numbers in Java");
    System.out.println("\n");
    System.out.print("\tEnter First Value  : ");
    a = input.nextInt();
    System.out.print("\tEnter Second Value : ");
    b = input.nextInt();
    System.out.print("\tEnter Third Value  : ");
    c = input.nextInt();

    sum = (a+b+c);

    average = (sum/3);

    System.out.println();
    System.out.print("\tThe Total Average is " + average + ".");
    System.out.println("\n");
    System.out.println("\tEnd of the Program");

  }
}

Categories
Java

Reverse a String in Java

I wrote this program to ask the user to give a string and then the program will reverse the given string using Java 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, web development using WordPress, Computer 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/

My video tutorial of Reverse a String in Java in my YouTube Channel
Sample Program Output

Program Listing

ReverseString.java

import java.util.*;

class ReverseString {

    public static void main(String args[]) {
        String original, reverse = "";
        int i=0;
        Scanner input = new Scanner(System.in);

        System.out.println();
        System.out.println("\tReverse a String in Java");
        System.out.println();
        System.out.print("\tGive a String to Reverse : ");
        original = input.nextLine();

        int length = original.length();
        System.out.println();
        for (i = length-1; i >= 0;  i--) 
             reverse = reverse + original.charAt(i);
        System.out.println("\tThe reverse string is " + reverse +".");
        
       System.out.print("\n\n");
       System.out.print("\tEnd of Program");
       System.out.println();
    }
}
Categories
Java

Hello World in Java

I wrote this simple program to display a hello world message on the screen using the 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, web development using WordPress, Computer 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/

My Hello World video tutorial in my YouTube Channel
Sample Program Output

Program Listing

HelloWorld.java

class HelloWorld {

public static void main(String args[]) {
System.out.print(“Hello World welcome to Java Programming”);
}

}


Categories
Java

Employee’s Payroll System that Display Highest and Lowest Salary in Java

Here is the code that is being shared with us by my good friend and fellow software engineer Sir Jake Macalig-og which I modify and improve that will compute the salary of the employees and sort the salary of the employees from highest to lowest. We wrote this code will some difficulty because there is no existing code on the Internet so we have to write it from scratch.


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/

Sample Program Output





Program Listing
payroll.java


package test;
import java.util.Scanner; 

public class payroll {
public static void main(String[] args) {  Scanner input = new Scanner (System.in);       int employees = 0;      

int num = 6;       

int  temp=0;      

String tempName;      

int[] grossPay  = new int[100];      

//arrays      

String[] names = new String [100];            int[] days = new int[100];    

  int[] rate = new int[100];      

int[] wages;      

//scanner        Scanner keyboard = new Scanner(System.in);      

System.out.println( "EMPLOYEES PAYROLL SYSTEM"); System.out.println();         System.out.println("It Displays Highest and Lowest Salary of Employees");         System.out.println();         

 for (int i = 1; i == 1;)        {          keyboard.nextLine();                      System.out.print( "Enter the Name of Employee  : ");          

names[employees] = keyboard.nextLine();
System.out.print( "Enter the daily rate        : ");          

rate[employees] = keyboard.nextInt();
System.out.print( "Enter the days worked       : ");          

days[employees] = keyboard.nextInt();
System.out.print("Do you want to enter again your employees? [1-Yes / 2-No] : ");        

  i = input.nextInt();          

employees++;      

}         

for (int i = 0; i < employees; i++)          {            grossPay[i] = days[i] * rate[i];                     }        

// Bubble Sort of Gross Pay of the Employees together with its Name here      

   for (int i = 0; i < employees - 1; i++)             {              

 for (int j = i + 1; j < employees; j++)                 {                  

 if (grossPay[i] < grossPay[j])                     {

temp = grossPay[i];                        grossPay[i] = grossPay[j];                        grossPay[j] = temp;
tempName = names[i];                        names[i] = names[j];                        names[j] = tempName;                    }                }            }
 System.out.print("\n\n");      System.out.print("\tHighest To Lowest Salary of Employees");     

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

for (int i = 0; i < employees; i++){             System.out.println(names[i] + ":" + grossPay[i]);       

}     

System.out.println();      System.out.println("\tEnd of Program");      System.out.println();  

      }
} // End of Code

Categories
Java

Miles To Kilometers Distance Table in Java

A simple program in Java that will display a table of distance equivalent of miles to kilometers and vice versa.

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 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/
Thank you very much for your help and support.

Sample Program Output

Program Listing

distance.java

package test;

public class distance {
public static void main(String[] args) {

final double KILOMETERS_PER_MILE = 1.609; System.out.print("\n\n");     

System.out.println("\tMiles To Kilometers Distance Table in Java"); System.out.print("\n\n");       

// Display table header

System.out.println( "Miles      Kilometers   |   Kilometers     Miles     ");
// Create and display tables

for (int m = 1, k = 11; m <= 10 && k <= 20; m++, k += 1) { System.out.printf( "%-11d%-10.3f", m, (m * KILOMETERS_PER_MILE)); System.out.print("   |   ");

System.out.printf( "%-15d%-6.3f\n", k, (k / KILOMETERS_PER_MILE)); }
}
}

Categories
Java

Payroll Program Sorting Salary in Descending Order in Java

A simple payroll program that I wrote using Java that uses a one-dimensional array and it’s sorted the salary in descending order. 

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/

Sample Program Output

Program Listing

package test;

import java.util.Scanner;

public static void main(String[] args) {
     Scanner input = new Scanner (System.in);
      int employees = 0;
      int num = 6; 
      int n, temp;
      int[] grossPay  = new int[100];
      //arrays
      String[] names = new String [100];
      int[] days = new int[100];
      int[] rate = new int[100];
      int[] wages;
      //scanner
       Scanner keyboard = new Scanner(System.in);
        System.out.println( "WELCOME TO THE PAYROLL SYSTEM");
        System.out.println("");
           for (int i = 1; i == 1;)
       {
         System.out.println( "Enter the Name of Employee :");
         names[employees] = keyboard.next();


         System.out.println( "Enter the rate for Employee : ");
         rate[employees] = keyboard.nextInt();


         System.out.println( "Enter the days worked for Employee : ");
         days[employees] = keyboard.nextInt();

         System.out.println("Do you want to enter again your employees? [1-Yes / 2-No] : ");
          i = input.nextInt();
          employees++;
      }
 System.out.println( "Here is the gross pay for each employee:");
      for (int i = 0; i < employees; i++)
      {
        grossPay[i] = days[i] * rate[i];
        if ( grossPay[i] < 10000 )
         {
          System.out.println("The gross pay for " + names[i] +
                            ": $" + grossPay[i] + ". Less than 10k");
         }
         else{
          System.out.println("The gross pay for " + names[i] +
                            ": $" + grossPay[i] + ". Greater than 10k");
        }

      }
    // Bubble Sort of Gross Pay of the Employees here
      for (int i = 0; i < employees; i++) 
        {
            for (int j = i + 1; j < employees; j++) 
            {
                if (grossPay[i] < grossPay[j]) 
                {
                    temp = grossPay[i];
                    grossPay[i] = grossPay[j];
                    grossPay[j] = temp;
                }
            }
        }
        System.out.print("\n\n");
        System.out.print("Descending Order of the Salaries of the Employees");
        System.out.print("\n\n");
        for (int i = 0; i < employees - 1; i++) 
        {
            System.out.print(grossPay[i] + ",");
        }
        System.out.print(grossPay[employees - 1]);

}

public class hello {

} // End of Code