Sunday, June 4, 2017

Addition of Two Numbers in FORTRAN

Here is a very simple program that I wrote in FORTRAN that will accept two numbers and then it will compute and display the sum of the two numbers. The code is very easy to understand and use. You may download the FORTRAN compiler free from charge in this link http://www.fortran.com/the-fortran-company-homepage/whats-new/g95-windows-download/

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

add.f95

program add

implicit none

integer a,b,sum

print *,''
print *, ' Addition of Two Numbers in Fortran'
print *,''
print *,' Written By: Mr. Jake R. Pomperada'
print *,''
print *, ' Enter Two Numbers : '
read *, a,b
sum = a + b
print *,''
print *, ' The sum of ', a,' and ' , b, ' is ' , sum,'.'
print *,''
print *,'End of Program'
end program

Hello World in FORTRAN

Hi guys in this article I would like to share with you my very first program written in FORTRAN or Formula Translator it is a Hello World program. The code is very short and easy to understand. I am using G95 Fortran Compiler that is also FREE to download at the Internet. Kindly see the link here http://www.fortran.com/the-fortran-company-homepage/whats-new/g95-windows-download/

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

hello.f95

 program hello 
 print *,"Hello World Jake R. Pomperada" 
 end program 



Saturday, June 3, 2017

Palindrome in Visual Basic 6

In this article I would like to share with you a simple program that will ask the user to give a string and then our program will check if the given string is a palindrome or not a palindrome.

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

Private Sub Command1_Click()

display1 = "The given string " & Trim(UCase(Text1.Text)) & " is a Palindrome."
display2 = "The given string " & Trim(UCase(Text1.Text)) & " is Not a Palindrome."

If IsPalindromeStrict(Text1.Text) = True Then
    MsgBox (display1)
  Else
     MsgBox (display2)
End If

End Sub


Public Function IsPalindromeStrict(pstrText As String) As Boolean
    Dim i As Long
    Dim iMin As Long
    Dim iMax As Long
    
    iMin = 1
    iMax = Len(pstrText)
    For i = 0 To (iMax - iMin) \ 2
        If Mid$(pstrText, iMin + i, 1) <> Mid$(pstrText, iMax - i, 1) Then Exit Function
    Next
    IsPalindromeStrict = True
End Function
 

Public Function IsPalindrome(ByVal pstrText As String) As Boolean
    Dim i As Long
    Dim iMin As Long
    Dim iMax As Long
    
    pstrText = LCase$(pstrText)
    
    i = 1
    Do
        Select Case Mid$(pstrText, i, 1)
            Case "a" To "z", "0" To "9": i = i + 1
            Case Else: pstrText = Replace(pstrText, Mid$(pstrText, i, 1), vbNullString)
        End Select
    Loop While i <= Len(pstrText)
    
    iMin = 1
    iMax = Len(pstrText)
    For i = 0 To (iMax - iMin) \ 2
        If Mid$(pstrText, iMin + i, 1) <> Mid$(pstrText, iMax - i, 1) Then Exit Function
    Next
    IsPalindrome = True
End Function

Private Sub Command2_Click()
End
End Sub


Friday, June 2, 2017

Yard To Feet Converter in C++

Here is a simple program that I wrote in C++ to ask the user to give a value in integer in yard and convert it to feet equivalent. I wrote this code using Dev C++ and CodeBlocks. Thank you.

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

My mobile number here in the Philippines is 09173084360.


Program Listing

#include <iostream>
#include <iomanip>

using namespace std;

main() {
    int yards[5][1];

    cout << "\t\t    Yard To Feet Converter";
    cout << "\n";
    cout << "\t Created By: Mr. Jake R. Pomperada,MAED-IT";
    cout << "\n\n";

       for (int row=0; row < 5; row++) {
           for (int col=0; col <1; col++) {
               cout << "Enter a Value in Yard :=> ";
               cin >> yards[row][col];
           }
       }

       cout << "\n=============================";
       cout << "\n      GENERATED REPORT     ";
       cout << "\n=============================";
       cout << "\n";
       for (int row=0; row < 5; row++) {
           for (int col=0; col <1; col++) {
                 cout << "\n" <<setw(5) <<  yards[row][col] <<
                 " yard(s)" << setw(5)  << " ==> "
                 << (yards[row][col] * 3)
                 << " feet(s)";
                  }

       }
       cout << "\n\n";
       system("PAUSE");
}

Three Attempts Login System in C++

A very simple program that I wrote using C++ which allows the user to login in the system it gives the user three times to login successfully in the system. I am using CodeBlocks as my text editor and Dev C++ as my C++ compiler in writing and testing this program. 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

#include <iostream>
#include <string>

using namespace std;

int main()
{

    string password = "admin";
    string passwordEntry;
    int attempts = 1;

    cout << "THREE ATTEMPTS LOGIN SYSTEM";
    cout <<"\n\n";
    cout << "Enter your password: ";
    getline(cin, passwordEntry, '\n');

    while ( passwordEntry != password && attempts <=2 )
    {
        cout << "\n";
        cout <<"Password Attempt No. : " <<attempts+1;
        cout << "\n";
        cout << "Enter Password Again : ";
        getline(cin, passwordEntry, '\n');
        attempts++;
    }

    if ( passwordEntry == password && attempts <=3 )
    {
        cout << "\n";
        cout << "Access Granted in the System.";
    }
    else
    {
        cout << "\n";
        cout << "Sorry, you are only allowed 3 password login attempts.";
        cout << "\n\n";
    }

}



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>