Categories
Java

Odd and Even Number Checker in Java

 Write a program using Java programming language to ask the user to give a number and then the program will check and determine whether the given number is an odd or even number and display the results on the  screen.

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 I also accepting computer repair, networking and Arduino Project development at a very affordable price.
My personal website is http://www.jakerpomperada.com

Program Listing

// odd_even.java
// Jake Rodriguez Pomperada,MAED-IT,MIT
// www.jakerpomperada.com
// jakerpomperada@gmail.com
// Bacolod City, Negros Occidental, Philippines.

package odd_even;

import java.util.Scanner;

public class odd_even {

	public static void main(String[] args) {
		        Scanner reader = new Scanner(System.in);
		
		        
		        System.out.println("\n");
			    System.out.print("\t\tOdd and Even Number Checker in Java");
			    System.out.println("\n");
			    
		        System.out.print("\tEnter a number: ");
		        int num = reader.nextInt();
		        
		        System.out.println();
		        
		        if(num % 2 == 0)
		            System.out.println("\tThe given number " 
		            + num + " is an Even Number.");
		        else
		            System.out.println("\tThe given number " 
		                     +num + " is an Odd Numbe.r");
	 System.out.println("\n");
     System.out.println("\tEnd of Program");
     System.out.println("\n\n");
	}
}

Categories
Java

Addition of Two Numbers in Java

 A simple program that will ask the user to give two numbers and then the program will compute the sum of the two numbers using Java programming language. I am using Eclipse as my Java integrated development environment.

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

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

Program Listing


import java.util.Scanner;

public class Addition {

	public static void main(String[] args) {
	   int num1, num2, sum;
	   Scanner sc = new Scanner(System.in);
	
	     System.out.println("\n");
	    System.out.print("\t\tAddition of Two Numbers in Java");
	    System.out.println("\n");
	 
        System.out.print("\tEnter First Number: ");
        num1 = sc.nextInt();
        
        System.out.print("\tEnter Second Number: ");
        num2 = sc.nextInt();
        
        sc.close();
        sum = num1 + num2;
        
        System.out.print("\n");
        System.out.print("\tThe sum of " + num1 + " and " 
                  + num2 + " is "+ sum + ".");
        System.out.println("\n");
        System.out.println("\tEnd of Program");
        System.out.println("\n\n");
	}

}
Categories
Java

Product of Two Numbers in Java

 A simple program that I wrote using Java programming language that will ask the user to give two numbers and then the program will compute the product of two numbers and display the results on the screen.I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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

Sample Program Output

/* Product.java
 * Author : Jake Rodriguez Pomperada, MAED-IT, MIT
 * Email  : jakerpomperada@gmail.com
 * Place  : Bacolod City, Negros Occidental Philippines
 */

import java.util.Scanner;

public class Product {
	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		  
		  System.out.println();
		  System.out.println("\tProduct of Two Numbers in Java");
		  System.out.println();
		  System.out.print("\tGive First Number: ");
		  int num1 = in.nextInt();
		   
		  System.out.print("\tGive Second Number: ");
		  int num2 = in.nextInt();
		   
		  System.out.println();
		  System.out.println("\t"+ num1 + " x " + num2 + " = " + num1 * num2);
		  System.out.println();
		  System.out.println("\tEnd of Program");
		  System.out.println("\n\n");
	}

}
Categories
Java

Real Fancy in Java

A program was written by my friend Thomas to test real fancy in Java programming language. Thank you Thomas for sharing your code to us.
I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/


Program Listing

SOLUTION 1

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
     public static void main (String[] args) throws java.lang.Exception
     {
         // your code goes here
         java.io.BufferedReader r = new java.io.BufferedReader
         (new java.io.InputStreamReader (System.in));
         int T = Integer.parseInt(r.readLine());
         for(int l=0;l<T;l++) {
             String st = r.readLine();
             String[] s = st.split(" ");String ans="regularly fancy";
             for(int i=0;i<s.length;i++){
                 if(s[i].equals("not")){ans="Real Fancy";break;}
             }System.out.println(ans);
             }
     }
}

SOLUTION 2

import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
     public static void main (String[] args) throws java.lang.Exception
     {
         try{
             Scanner scan=new Scanner(System.in);
         int t=scan.nextInt();
      scan.nextLine();
         while (t-- > 0) {
             String[] words = scan.nextLine().split(" ");
             String ans = "regularly fancy";
             for (String s : words) {
                 if (s.equals("not")) {
                     ans = "Real Fancy";
                     break;
                 }
             }
             System.out.println(ans);
      }
         }catch(Exception e){
             System.out.println(e);
         }
}
}
Categories
Java

Remove Vowels in Java

I wrote this program to ask the user to give string and then the program to remove the vowels in the given string using Java programming language.
I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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.comI am also a book author you can purchase my books on computer programming and information technology in the following links below. https://www.unlimitedbooksph.com/


Program Listing

// demo.java
// Written By: Jake Rodriguez Pomperada
// Barangay Alijis, Bacolod City, Negros Occidental Philippines.
// www.jakerpomperada.com
// jakerpomperada@gmail.com
// May 14, 2020  Thursday

package test;

import java.util.Scanner;

public class demo {

   static String Remove_Vowels(String str)
   {
    return  str.replaceAll("[AIEOUaieou]","" );
   }
	
	public static void main(String[] args) {
     
	Scanner input = new Scanner(System.in);
     
     String str_given,display_result;
     
    System.out.print("\n\n");
    System.out.print("\tRemove Vowels in Java");
    System.out.print("\n\n");
    System.out.print("\tGive a String : ");
    str_given = input.nextLine();
    
    System.out.print("\n"); 
    System.out.print("\tString : " + str_given);
    display_result = Remove_Vowels(str_given);
    System.out.print("\n");
    System.out.print("\tResult : " + display_result);
    System.out.println();  
	}

}
Categories
Java

Remove Consonants in Java

I wrote this program to ask the user to give string and then the program to remove the consonants in the given string using Java programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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.comI am also a book author you can purchase my books on computer programming and information technology in the following links below. https://www.unlimitedbooksph.com/

Program Listing

// demo.java
// Written By: Jake Rodriguez Pomperada
// Barangay Alijis, Bacolod City, Negros Occidental Philippines.
// www.jakerpomperada.com
// jakerpomperada@gmail.com
// May 14, 2020  Thursday

package test;

import java.util.Scanner;

public class demo {

   static String Remove_Consonants(String str)
   {
    return  str.replaceAll("[BCDFGHJKLMNPQRSTVXZbcdfghjklmnpqrstvxz]","" );
   }
	
	public static void main(String[] args) {
     
	Scanner in = new Scanner(System.in);
     
     String str_given,display_result;
     
    System.out.print("\n\n");
    System.out.print("\tRemove Consonants in Java");
    System.out.print("\n\n");
    System.out.print("\tGive a String : ");
    str_given = in.nextLine();
    
    System.out.print("\n"); 
    System.out.print("\tString : " + str_given);
    display_result = Remove_Consonants(str_given);
    System.out.print("\n");
    System.out.print("\tResult : " + display_result);
    System.out.println();  
	}

}
Categories
Java

Addition of Two Numbers Using OOP in Java

 I wrote this simple program in Java to ask the user to give two numbers and then the program will compute the total sum of two numbers.
I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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.comI am also a book author you can purchase my books on computer programming and information technology in the following links below.https://www.unlimitedbooksph.com/

Program Listing

package oop_java;

import java.util.Scanner;
/**
 * NetBeans IDE 8.2
 * @author Mr. Jake R. Pomperada
 * March 22, 2018  Thursday
 * Bacolod City, Negros Occidental
 */
class  Addition {

    public int val_a;
    public int val_b;
    public int sum;
    
public void getdata() {
  Scanner input = new Scanner(System.in);

  System.out.print("Addition of Two Numbers Using OOP ");
  System.out.println("\n");
  System.out.print("Give First Value  : ");
  val_a = input.nextInt();
  System.out.print("Give Second Value :  ");
  val_b = input.nextInt();
 
 }
 
  public void calculate(){
     sum =(val_a + val_b);
  }
          
 
 public void display() {
  System.out.println("\n");
  System.out.println("The sum of " + val_a + " and "
          + val_b + " is " + sum + ".");
  System.out.println("\n");
  System.out.println("End of Program");
 }
 public static void main(String args[]) {
  Addition add = new Addition();
  add.getdata();
  add.calculate();
  add.display();
 }
}
Categories
Java

Leap Year Checker Using OOP in Java

I wrote this program to accept the user input a year and then the program will check if the given year is a leap year or not using object-oriented programming in Java.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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.unlimitedbooksph.com/

Program Listing

package oop_java;

import java.util.Scanner;
/**
 * NetBeans IDE 8.2
 * @author Mr. Jake R. Pomperada
 * March 22, 2018  Thursday
 * Bacolod City, Negros Occidental
 */

public class LeapYear {
  public int year;
  public boolean leap = false;
  public String result;

 public void getdata() {
  Scanner input = new Scanner(System.in);
  System.out.println();
  System.out.println(" Leap Year Checker Using OOP");
  System.out.println();
  System.out.print("Enter Year :  ");
  year = input.nextInt();
  
 }
 public void checkyear() {
    if(year % 4 == 0)
        {
            if( year % 100 == 0)
            {
                // year is divisible by 400, hence the year is a leap year
                if ( year % 400 == 0)
                    leap = true;
                else
                    leap = false;
            }
            else
                leap = true;
        }
        else
            leap = false;

        if(leap)
            result =  year  + " is a leap year.";
        else
             result =  year + " is not a leap year.";
    }
     
  
 public void display() {
  System.out.println();
  System.out.println("===== DISPLAY RESULT =====");
  System.out.println();
  System.out.println(result);
  System.out.println();
 }
 public static void main(String args[]) {
   LeapYear year = new LeapYear();
  year.getdata();
  year.checkyear();
  year.display();
 }
}
Categories
Java

String in Java

A simple program to show how to declare and use string in Java programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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/

Program Listing

package com.example.java;

public class Main {

    public static void main(String[] args) {
	    System.out.println("Hello from Java Programming!");
        String TString = "David";
        System.out.println("Your name is " + TString);
    }
}
Categories
Java

Sum of Two Numbers in Java

A simple java program to accept two numbers and then it will compute the sum of two numbers and display the results on the screen.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, 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/

Program Listing

package com.example.java;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.print("Enter a numeric value: ");
        String input1 = sc.nextLine();
        double d1 = Double.parseDouble(input1);

        System.out.print("Enter a numeric value: ");
        String input2 = sc.nextLine();
        double d2 = Double.parseDouble(input2);

        double result = d1 + d2;

        System.out.println("The answer is " + result);

    }
}