Sunday, May 28, 2017

Odd and Even Number in Oracle PL/SQL

Here is a very simple program that I wrote using Oracle PL/SQL to ask the user to give a number and then our program will check and tell us if the given number is an ODD or EVEN Number using PL/SQL statements. The code is very easy to understand 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

/* Odd and Even Number Program in Oracle PL/SQL           */
/* Written By Mr. Jake R. Pomperada                       */
/* Language : PL/SQL                                      */
/* Date     : May 28, 2017  Sunday                        */

SET SERVEROUTPUT ON

DECLARE
              
         title   varchar2(50) :='Odd and Even Number Program in PL/SQL';
         author   varchar2(50) :='Written By: Mr. Jake R. Pomperada,MAED-IT';
        
         num_value number:=&num_value;
              
    BEGIN
             
             dbms_output.put_line(chr(13)||chr(10) || UPPER(title));
             dbms_output.put_line(chr(13)||chr(10) || UPPER(author));
             
             
   IF MOD(num_value,2)=0
    THEN
                 dbms_output.put_line(chr(13)||chr(10) || 'The given number ' || num_value || ' is a EVEN Number.');
                 dbms_output.put_line(chr(13)||chr(10)); 
                 dbms_output.put_line('END OF PROGRAM');
    ELSE
                  dbms_output.put_line(chr(13)||chr(10) || 'The given number ' || num_value || ' is a ODD Number.');
                 dbms_output.put_line(chr(13)||chr(10)); 
                 dbms_output.put_line('END OF PROGRAM');
    END IF;
     
   END;
   



Palindrome Program in Oracle PL/SQL

A very simple program that I wrote using Oracle PL/SQL to accept input string from the user and then it will check if the given string is a Palindrome or Not a Palindrome. I am still a beginner in Oracle PL/SQL 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.




Input of Values Screen Shots






Sample Program Output



Program Listing

/* Palindrome Program in Oracle PL/SQL                    */
/* Written By Mr. Jake R. Pomperada                          */
/* Language : PL/SQL                                                  */
/* Date     : May 28, 2017  Sunday                             */

SET SERVEROUTPUT ON;
DECLARE
        
         get_string varchar2(50);
         rev_string varchar2(50);
         a          number(5);
         
         title   varchar2(50) :='Palindrome Program in PL/SQL';
         author   varchar2(50) :='Written By: Mr. Jake R. Pomperada,MAED-IT';
         
    BEGIN
          
             get_string := '&get_string';
             
             for a in reverse 1..length(get_string) loop
               rev_string := rev_string || substr(get_string,a,1);
             end loop;
             
             dbms_output.put_line(chr(13)||chr(10) || UPPER(title));
             dbms_output.put_line(chr(13)||chr(10) || UPPER(author));
              dbms_output.put_line(chr(13)||chr(10)); 
             dbms_output.put_line('The original string is ' || UPPER(get_string) || '.');
             dbms_output.put_line(chr(13)||chr(10)); 
             dbms_output.put_line('The reverse string is ' || UPPER(rev_string) || '.');
   
   
      IF rev_string = get_string
   THEN
                 dbms_output.put_line(chr(13)||chr(10) || 'The given string ' || UPPER(get_string) || ' is a Palindome.');
                 dbms_output.put_line(chr(13)||chr(10)); 
                 dbms_output.put_line('END OF PROGRAM');
   ELSE 
                 dbms_output.put_line(chr(13)||chr(10) || 'The given string ' || UPPER(get_string) || ' is Not a Palindome.');
                 dbms_output.put_line(chr(13)||chr(10)); 
                 dbms_output.put_line('END OF PROGRAM');
    END IF;
          
   END;
   



Division of Two Numbers Using Oracle PL/SQL

In this article I would like to share with you a sample program that will ask the user to give two numbers and then it will compute the quotient of the two numbers using Oracle PL/SQL programming  language. I also added a function to check if the given numerator is zero it will display an error message the Divide Over Zero is Not Allowed. The code is very easy to understand and use. 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


Error Checking Screen Output



Program Listing
/* Division of Two Numbers With Exception Handling        */
/* Written By Mr. Jake R. Pomperada                       */
/* Language : PL/SQL                                      */
/* Date     : May 28, 2017  Sunday                        */

SET SERVEROUTPUT ON;
DECLARE
        
         solve NUMBER;
         message1 varchar2(50):= 'Division By Zero is not allow.';
         title   varchar2(50) :='Division of Two Numbers Program in PL/SQL';
         author   varchar2(50) :='Written By: Mr. Jake R. Pomperada,MAED-IT';
    
         /* User Input values */
         
         a number:=&a;
         b number:=&b;
         
    BEGIN
          
             solve := (a/b);
             dbms_output.put_line(chr(13)||chr(10) || title);
             dbms_output.put_line(chr(13)||chr(10) || author);
             dbms_output.put_line(chr(13)||chr(10)); 
             dbms_output.put_line('The Value of A is ' || a);
             dbms_output.put_line('The value of B is ' || b);
             dbms_output.put_line(chr(13)||chr(10));
             dbms_output.put_line('The result is ' || solve || '.');
    EXCEPTION
           WHEN ZERO_DIVIDE
   THEN
                 dbms_output.put_line(chr(13)||chr(10) || message1);
                 dbms_output.put_line(chr(13)||chr(10)); 
                 dbms_output.put_line('The Value of A is ' || a);
                 dbms_output.put_line('The value of B is ' || b);
   END;
   



Friday, May 26, 2017

Addition of Three Numbers Using Oracle PL/SQL

Here is a very simple program that I wrote using PL/SQL in Oracle to compute the sum of three numbers. The code is very short and very easy the syntax is very similar to Pascal programming language.  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

declare
a number:=&a;
b number:=&b;
c number:=&c;
sum_total number;
begin
sum_total:=(a+b+c);
dbms_output.put_line('The total sum is '||sum_total ||'.');
end;
/


Thursday, May 25, 2017

Hello World in Oracle PL/SQL

This will be my first time to write an PL/SQL code in Oracle using SQL Developer to display hello world message on the screen. Actually learning PL/SQL is easy and fun.  I hope you will learn from this one. 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

Set serveroutput on;
DECLARE
message1 varchar2(50):= 'My First PL/SQL Script in Oracle';
message2 varchar2(50):= 'Hello, World Jake Pomperada';
BEGIN
dbms_output.put_line(chr(13)||chr(10) || message1 || chr(13)||chr(10) 
                     ||chr(13)||chr(10) || message2);
END;
/


Saturday, May 20, 2017

Hello World in Java Spring Framework

Hi there thank you for visiting my website. In this article I would like to share with you my very first program using Java Spring Framework to display a Hello World message on the screen. This program is very simple to write using other programming language but in my case I have to learn Java Spring Framework to improve my knowledge in Java. I hope you will find my work useful. Thank you very much.

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





Eclipse Screenshots




Program Listing


HelloWorld.java

package com.jake.java.demo;

public class HelloWorld {
 private String my_message;

public String getMy_message() {
System.out.print("\n\n");
System.out.println("\tHello " + my_message);
System.out.print("\n");
System.out.print("\t   ===== END OF PROGRAM =====");
return my_message;
}

public void setMy_message(String my_message) {
this.my_message = my_message;
}
  
}


MainApp.java

package com.jake.java.demo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainApp {
   public static void main(String[] args) {
      @SuppressWarnings("resource")
ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
      HelloWorld obj = (HelloWorld) context.getBean("HelloWorld");
      obj.getMy_message();
   }
}


Beans.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

   <bean id = "HelloWorld" class = "com.jake.java.demo.HelloWorld">
      <property name = "my_message" value = "World Jake R. Pomperada, MAED-IT"/>
   </bean>

</beans>





Sunday, May 14, 2017

Leap Year Checker in Java OOP Using Getters and Setters

Here is a sample program that I wrote using Java to check if the given year is a leap year or not a leap year using object oriented programming approach. The code is very easy to understand and use.

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 demo;

import java.util.Scanner;

class CheckLeapYear {
public int YearGiven=0;


public CheckLeapYear(int Year)
{
YearGiven = Year;
}
public int getYearGiven() {
return YearGiven;
}

public void setYearGiven(int Year) {
YearGiven = Year;
}
public void displayResult()
{
 
   if((YearGiven % 400 == 0) || ((YearGiven % 4 == 0) && (YearGiven % 100 != 0))) {
   System.out.println();
System.out.print("The year " + YearGiven + " is a LEAP YEAR.");
   System.out.println("\n\n");
   System.out.print("===== END OF PROGRAM ======");
   System.out.println();
   }
           else {
        System.out.println();
    System.out.print("The year " + YearGiven + " is NOT LEAP YEAR.");
       System.out.println("\n\n");
       System.out.print("===== END OF PROGRAM ======");
       System.out.println();
           }
}
}
public class LeapYear {

/* Written By: Mr. Jake R. Pomperada, MAED-IT  */
/* Java                                        */
/* May 14, 2017    Sunday                      */
public static void main(String[] args) {
 Scanner input = new Scanner(System.in);
 int Year=0;
 
 System.out.println();
     System.out.println("Leap Year Checker in JAVA OOP");
     System.out.println();
     System.out.print("What is the year ? :  ");
     Year = input.nextInt();
     
     CheckLeapYear Given_Year = new CheckLeapYear(Year);
     
     Given_Year.displayResult();
     input.close();
}

}



CRUD in C# Using MS SQL Server and Entity Framework

In this article I would like to share it  again the work of one of my best friend and fellow software engineer Mr. Dave Marcellana From Talisay City, Negros Occidental Philippines. This sample program will show you how to created an CRUD application using Microsoft SQL Server and Entity Framework. He is using Microsoft Visual Studio 2017 in written this application.

 We are thankful that Dave us this work to benefit all of us.  Thanks Dave.




Sample Program Output




Power of a Number in Java OOP

Here is a simple program to demonstrate Object Oriented Programming in Java I called this program power of a number. It will ask the user to give base and exponent value and then our program will compute its power value. The code is written in object oriented programming format and easy to understand. 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 demo;

import java.util.Scanner;


class check_power {
public double val_base,val_exponent;
public check_power(double base, double exponent)
{
val_base = base;
val_exponent = exponent;
}
public void set_power(double base, double exponent) {
val_base = base;
val_exponent = exponent;
}
public double get_base(double base) {
return(val_base);
}
public double get_exponent(double exponent) {
return(val_exponent);
}
public void displayResult()
{
 
            double results = Math.pow(val_base,val_exponent);
   System.out.println();
System.out.print("The Power value is " + results + ".");
   System.out.println("\n\n");
   System.out.print("===== END OF PROGRAM ======");
   System.out.println();
}
}


public class power_number {

public static void main(String[] args) {
   
int a=0,b=0;
 Scanner input = new Scanner(System.in);
 System.out.println();
     System.out.println("Power Number Solver in JAVA OOP");
     System.out.println();
     System.out.print("Give Base Value : ");
     a = input.nextInt();
     System.out.print("Give Exponent Value : ");
     b = input.nextInt();
   
     check_power solve = new check_power(a,b);
     
     solve.displayResult();
     input.close();

}

}