Sunday, February 14, 2016

Area of a Circle in Pascal

A simple program that I wrote in Pascal that will compute the area of the circle based on the given value by the user. In this program I wrote using Turbo Pascal 5.0 as my Pascal compiler.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output

Program Listing

Program Area_Circle;
Uses Crt;

Const
  Pi = 3.1416;

Var
  Radius : Integer;
  Area    : Real;


Begin
  Clrscr;
  Writeln('Area of a Circle Solver');
  Writeln;
  Write('Enter the Radius of the Circle : ');
  Readln(Radius);

  Area := (Pi * Radius * Radius);

  Writeln;
  Writeln('The Area of the Circle is ' ,Area:8:2,'.');
  Writeln;
  Writeln('Thank You For Using This Program');
  Readln;
End.

Odd and Even Number Checker in Pascal

A simple program that I wrote using Pascal as my programming language that will ask the user to give a  number and then our program will determine if the given number by the user is ODD or EVEN number. The program itself is very short and easy to understand. I am using Turbo Pascal 6 as my compiler in writing this program.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output

Program Listing

Program Odd_Even_Number;
Uses Crt;

Var Number : Integer;
    R     : Integer;
    Ch    : Char;

Begin
  Clrscr;
  Repeat
  Writeln;
  Number := 0;
  R := 0;
  Writeln('Odd and Even Number Checker in Pascal');
  Writeln;
  Writeln;
  Write('Enter a Number : ');
  Readln(Number);

  R := Number MOD 2;

     If (R=0) Then
       Begin
         Writeln(Number ,' is a Even Number. ');
         Writeln;
       End
     Else
       Begin
         Writeln(Number,' is Odd Number. ');
         Writeln;
       End;
    Writeln;
    Write(' Do you want to continue y/n ?');
    Ch := Upcase(readkey);
    Until Ch = 'N';
    Writeln;
    Writeln;
    Write('Thank You For Using This Software.');
    Readln;                                  
 End.



Palindrome Program in Pascal


A simple program that I wrote before in Pascal to check if the word given by the user is a Palindrome or not a Palindrome. The code is very simple and easy to understand.


If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Program Listing


Program Palindrome;
Uses Crt;
Label Finish;
VAR
StrIn, dForward, Reversed:String;
n:Integer;
ch:Char;
Palin:Boolean;
Begin
     Clrscr;
     Writeln; Writeln; Writeln;
     Write('              PALINDROME PROGRAM IN PASCAL        ');
     Writeln(' Just Press Enter to quit the Program');
     Repeat
           Writeln;
           Write('Enter a Word :==> ');
           Readln(StrIn);
           If StrIn = '' Then Goto Finis;
           dForward := '';  Reversed := '';
               For n := 1 to Length(StrIn) Do
           Begin
                ch := UpCase(StrIn[n]);
                If ch in ['A'..'Z'] Then
                Begin
                     dForward := dForward + ch;
                     Reversed := ch + Reversed
                End;
           End;
           Palin := dForward = Reversed;  
           If Palin then Writeln('"',StrIn, '" is a palindrome.') 
           Else Writeln('"',StrIn, '" is not a palindrome.'); 
Finish: 
     Until StrIn = ''; 
END.

Positive and Negative Number Checker in Pascal

Here is a sample program that I wrote using Pascal as my programming language that will ask the user to give a number and then our program will check whether the give number of the user is a positive or negative number after which our program will ask the user if the user will continue using the program or not.  This program that I wrote is very simple it brings back the memories during my college day's when I am taking up Pascal programming I am using Turbo Pascal 6.0 as my Pascal compiler in this program.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Sample Program Output


Program Listing

Program Positive_and_Negative_Numbers;
Uses Crt;

Var Number : Integer;
    Ch     : Char;

Begin
  Clrscr;
  Repeat
  Writeln;
  Number := 0;
  Writeln('Positive and Negative Number Checker in Pascal');
  Writeln;
  Writeln;
  Write('Enter a Number : ');
  Readln(Number);

     If (Number >=0) Then
       Begin
         Writeln(Number ,' is a Positive Number. ');
         Writeln;
       End
     Else
       Begin
         Writeln(Number,' is a Negative Number. ');
         Writeln;
       End;
    Writeln;
    Write(' Do you want to continue y/n ?');
    Ch := Upcase(readkey);
    Until Ch = 'N';
    Writeln;
    Writeln;
    Write('Thank You For Using This Software.');
    Readln;                                  
 End.


Average of Ten Numbers Using Array in Turbo Pascal 6.0

Pascal programming language is the first programming language that I have learned during my first years and second year in college taking up my course in Bachelor of Science in Computer Science in the University of Negros Occidental - Recoletos, Bacolod City, Philippines. 

I find this programming language very easy to learn primary reason is that it uses commonly used english words and terms very near to user understand indeed. I learned many things in Pascal that I was able to used it in learning other programming language such as C, C++, BASIC and among others.

In this sample program that I wrote using Pascal as my programming language and Turbo Pascal 6.0 as my Pascal compiler. This program will ask the user to give ten numbers and then our program will find the average of the ten number being provided by the user using one dimensional array in Pascal.

The program itself is very easy to understand and very useful for those who wants to learn Pascal programming. I know now a day's programming in Pascal is not popular compared to the past 20 years. I just try my best to share the things that I learned before in Pascal programming.


If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output



Program Listing


Program Average_Ten_Numbers;
Uses Crt;
Var
  NumberArray : Array[1..10] of Integer;
  Average : Real;
  i : integer;

Begin
  Clrscr;
  Gotoxy(24,2);
  Writeln('Average of Ten Numbers in Pascal');
  Writeln;

  For i :=  1 To 10 Do
    Begin
      Write('Enter Item No. ' ,i, ' : ');
      Readln(NumberArray[i]);
    End;

  Average := 0;
  i := 1;

  Repeat
    Average := Average + NumberArray[i];
    i := i + 1;
  Until i > 10;

  Average := Average / 10;
  Writeln;
  Writeln('The average is : ',Average:0:2);
  Writeln;
  Writeln(' Thank you for using This Software');
  Readln;
End.




Sunday, February 7, 2016

Kilograms To Pounds Converter in Python


A simple program that I wrote in Python as my programming language that will ask the user to give how many kilograms and then it will convert it to pounds equivalent. The code is very simple I intended my work for beginners like me in Python programming.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

import math

print('\n')
print('\t Kilograms To Pounds in Python')
print('\n')

kilograms = input('How many kilograms : ')

solve_pounds = (kilograms * 2.20462262 )

print('\n')
print('The {0} Kilogram(s) is equivalent to {1} Pound(s). '.format(kilograms,round(solve_pounds,2)))
print('\n')
print('Thank you for using this program')



Basic Math Operations in Python

This is a simple program that I wrote using Python as my programming language that program will ask the user to give two numbers and then our program will find the sum, difference, product and quotient of the two numbers that is being provided by our end user of the program. I am still a beginner in Python programming but I find Python an easy to learn programming language.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing

print('\n')
print('\t Basic Math Operations in Python')
print('\n')
first_value  = int(input('Enter first  value : '))
second_value = int(input('Enter second value : '))

addtion = (first_value + second_value)
subtraction = (first_value - second_value)
product = (first_value * second_value)
division = (first_value / second_value);

print('\n')
print("The sum of {0} and {1} is {2} .".format(first_value,second_value,addtion)."\n");
print("The difference between {0} and {1} is {2} .".format(first_value,second_value,subtraction)."\n");
print("The product of {0} and {1} is {2} .".format(first_value,second_value,product)."\n");
print("The quotient of {0} and {1} is {2} .".format(first_value,second_value,division)."\n");
print('\n')
print('Thank you for using this program')





Saturday, February 6, 2016

Checking Prime Number in C++

Here is a sample program that I wrote a long time ago in C++ to check for prime numbers. I have a very busy schedule at work that why I was not able to update my blog. Anyway I hope you will find my work useful in your programming assignments in C++ programming.

If you have some questions please send me an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Program Listing

#include <iostream.h>


 int check_prime(int x)
 {
 int var1=0,var2=0,flag=0;
 cout << "\n\n";
 cout << "\t List of Prime Numbers";
 cout << "\n\n";
 for(var1 = 2; var1 <= x; var1++){
flag = 1;
for(var2 = 2; var2 < var1; var2++){
if((int)var1 % (int)var2 == 0){
flag = 0;
}
}

if(flag == 1){
cout << var2;
cout << " ";
}
}
 }
 main(){


   int values=0;
   cout << "\t\tPrime Number Generator Version 1.0";
   cout << "\n\n";
   cout << "Enter a Number : ";
   cin >> values;

   check_prime(values);
cout << "\n\n";
system("pause");
}

Sunday, January 24, 2016

Reading in a Text File in C++

A simple program that I wrote before in C++ to read a text file. The code is very short and easy to understand.

If you have some questions please send me an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Program Listing


#include <iostream>
#include <fstream>

using namespace std;

main() {

     string line;
     ifstream a("test.txt");

     while(!a.eof()) {
         if (a.is_open() == false) {
             cout << "Unable to open the file";
             break;
         }
         getline(a,line);
         cout << "\n" << line;
     }


     a.close();
     cout << "\n\n";
     system("pause");
}


Writing in a text file using C++

Here is a sample program that I wrote a long time ago to write the content in a text file using C++. The code is very simple and easy to understand.  

If you have some questions please send me an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Program Listing

#include <iostream>
#include <fstream>

using namespace std;

main() {
     string name,course, school, position;
     int age=0;

     cout << " ======= Resume Maker Version 1.0 =============";
     cout << "\n\n";

     cout << "Enter the name of the Person : ";
     getline(cin,name);
     cout << "Enter the age of the Person : ";

     cin >> age;

     cout << "Enter the course of the Person : ";
    cin.ignore(80,'\n');
    getline(cin,course);

     cout << "Enter the school Graduated  : ";
     getline(cin,school);
     cout << "Enter the Position Applying : ";
     getline(cin,position);

     cout << "\n\n";
     cout << "\t  RECORDS HAS BEEN SAVED IN THE DATABASE";

    ofstream my_file("resume.txt");
    my_file << "\n\n\t\t ==== RESUME VITAE ==== ";
    my_file << "\n\n";
    my_file << "\n \t Name      :  " <<name;
    my_file << "\n \t Age       :  " <<age;
    my_file << "\n \t Course    :  " <<course;
    my_file << "\n \t School    :  " <<school;
    my_file << "\n \t Position  :  " <<position;

    my_file.close();
    return 0;
}






Crud with Grid in PHP and MySQL

A program that is being provided by my bestfriend and fellow software engineer Mr. Dave Marcellana. This program is a CRUD application with grid in PHP and MySQL. I hope you will find the work of Dave useful in your learning PHP programming.

Thank you and God Bless.

If you have some questions please send me an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output




Point of Sale (POS) in Visual Basic 6

A Point of Sale Software written by my best friend and fellow software engineer named Mr. Dave Marcellana using Microsoft Visual Basic 6.  I hope you will find his work useful.

Thank you and God Bless.

If you have some questions please send me an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Sample Program Output