Thursday, March 30, 2017

Swapping of Two Numbers in Turbo Pascal

In this article I would like to share with you guys a program that I wrote using Turbo Pascal our program will ask the user to give two numbers and then it will swap the arrangement of the two numbers given by our user. The program uses Turbo Pascal for Windows as our Pascal compiler. 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

Program swap_numbers;

Uses WinCrt;

var a,b,temp : integer;

Begin
clrscr;
 writeln;
 Writeln;
 writeln('SWAPPING OF TWO NUMBERS IN PASCAL');
 writeln;
 write('Give first number : ');
 readln(a);
 write('Give second number : ');
 readln(b);
 writeln;
 write('Before Swapping : A = ',a, ' and B = ',b);
 writeln;

  temp := a;
  a:=b;
  b:=temp;

 writeln;
 writeln;
 write('After Swapping : A = ',a, ' and B = ',b);
 writeln;
 Writeln;
 writeln('END OF PROGRAM');
readln;

End.



Hello World in Turbo Pascal

Here is a very simple program that I wrote using Turbo Pascal to display a message Hello World on the screen of your computer. Most of the first programming examples when teaching computer programming is to display a message on the screen. Hello World is the most common given examples to the students. I am using Turbo Pascal for Windows in this sample program of ours. 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

{Date : March 30, 2017    Thursday            }
{Metro Manila, Philippines                  }
{jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program hello_world;

Uses WinCrt;

Begin
clrscr;
 writeln;
 Writeln;
 writeln('HELLO WORLD !!! ');
 writeln;
 Writeln;
 writeln('END OF PROGRAM');
readln;
End.




Hong Kong Style Noodles Bacolod Branch


Hi there this is article is not related to programming I would like to market our new business which will be open in April 1, 2017 at Lopues Mandalagan Bacolod City. The name of our business is Hong Kong Style Noodle and Dimsun we sell authentic Chinese noodles and Dim sum at very affordable price with excellent taste because you are the one who will mix you own sauce that match to your taste buds.








It is located at the grocery entrance section of Lopues Department Store in Barangay Mandalagan, Bacolod City, Negros Occidental Philippines.   For order you can call or text this number 0917 - 701 - 0825 or telephone number (034) 433 - 5675 look for Mrs. Allie Pomperada.

Thank you very much.


While Loop Statement in Turbo Pascal

In this article I would like to share with you a sample program to demonstrate how to use while loop statement using Pascal as our programming language. I am using Turbo Pascal For Windows as my Pascal compiler in this sample program. What does the program will do is to display a series of number from 1 to 20. I hope you will learn something in this simple program that I wrote. 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

{Written By: Mr. Jake R. Pomperada, MAED-IT }
{Date : March 30, 2017    Thursday            }
{Metro Manila, Philippines                  }
{jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program while_loop;

Uses WinCrt;

Var a : Integer;

Begin
clrscr;
 a := 1;

 writeln;
 Writeln;
 writeln('WHILE LOOP STATEMENT IN PASCAL');
 writeln;
   While (a<=20) Do
     Begin
       Write(' ',a,' ');
       a := a + 1;
     End;

 writeln;
 Writeln;
 writeln('END OF PROGRAM');
readln;
End.



Tuesday, March 28, 2017

While Loop in C

Hi there in this article I will show you how to use While loop statement using C language. Looping statements is very important in any programming language it allows us to repeat a certain command in our program. What does the program will display a series of numbers from 1 to 10. 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

Program Listing

#include <stdio.h>

int main()
{
    int a=1;

    printf("\n\n");
    printf("\tWHILE LOOP STATEMENT IN C");
    printf("\n\n");

    while (a<=10) {
        printf("Loop Iteration No. %d  ",a);
        printf("\n");
    a++;
    }
    printf("\n\n");
    printf("End of Program");
    printf("\n\n");
}




Thursday, March 23, 2017

Legal Age Checker in Turbo Pascal

Here is a simple program that will check if the given age of the user is already legal or  not let us assume the legal is 18 years old it uses if else statement in Pascal to check. 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


Program Listing

{Written By: Mr. Jake R. Pomperada, MAED-IT }
{Date : March 23, 2017    Thursday            }
{Metro Manila, Philippines                  }
{jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program legal_age_checker;

Uses WinCrt;

Var Age : Integer;

Begin
clrscr;
 Age := 0;

 writeln('LEGAL AGE CHECKER IN PASCAL');
 writeln;
 Write('Enter Your Age : ');
 Readln(Age);

   If (Age>=18) then
   Begin
     Writeln;
     Write('You are already an Adult at the age of ',age,'.');
   End
  Else
    Begin
        Writeln;
        Write('You are still a Minor at the age of ',age,'.');
    End;
 writeln;
 writeln;
 Writeln;
 writeln('  END OF PROGRAM  ');
readln;
End.

Odd and Even Number Checker in Turbo Pascal

Here is a sample program that will ask the user to give a number and then our program will determine if the given number is an odd or even number using Pascal as our programming language. I am using Turbo Pascal for Windows in this sample 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

{ Written By: Mr. Jake R. Pomperada, MAED-IT                           }
{ Date : March 23, 2017    Thursday                                               }
{ Metro Manila, Philippines                                                              }
{ jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program even_odd_numbers;

Uses WinCrt;

Var N, R : Integer;

Begin
clrscr;
 N := 0;
 R := 0;

 writeln('EVEN AND ODD NUMBER CHECKER IN PASCAL');
 writeln;
 Write('Give a Number : ');
 Readln(N);
 R := (N MOD 2);
   if (R=0) then
   Begin
     Writeln;
     Write('The given number ' ,n,' is EVEN number.');
   End
  Else
    Begin
        Writeln;
        Write('The given number ' ,n,' is ODD number.');
    End;
 writeln;
 writeln;
 Writeln;
 writeln('  END OF PROGRAM  ');
readln;
End.


Wednesday, March 22, 2017

Side Pyramid Image in C

Hello there in this article I would like to share with you a sample program that will display side pyramid in C. The code uses two for loop statements to create the side pyramid image in C. I hope you will like my work. I am using CodeBlocks as my text editor and Dev C++ as my C/C++ compiler in this sample 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 <stdio.h>
#include <conio.h>
#include <math.h>

/* Side Pyramid Image                                              */
/* Written By: Mr. Jake R. Pomperada, MAED-IT  */
/* March 22, 2017                                                  */

int main()
{

    int size=5;
    int a=0,b=0;

     printf("SIDE PYRAMID IMAGE ");
     printf("\n\n");
     for (a=size; a>=-size; a--) {
        for (b=size; b >= abs(a); b--) {
            printf("*");
        }
      printf("\n");
     }
    printf("\n\n");
    printf("End of Program");
    printf("\n\n");
}



Sunday, March 19, 2017

Student Grade Solver Using Pointers in C++

A simple program that I wrote using C++ to compute the student grades using functions and pointers as my data structure. The code is very simple and easy to understand I am using CodeBlocks as my text editor and Dev C++ as my C++ compiler in this sample 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.



Program Listing


#include <iostream>
#include <iomanip>

 using namespace std;

float X_Prelim=0.00, X_Midterm=0.00, X_Endterm=0.00;

 float solve_grade(float *prelim,  float *midterm, float *endterm)
 {
     float compute_grade =0.00;
     bool  result;
     compute_grade = (*prelim * 0.30) + (*midterm * 0.30)
                     + (*endterm * 0.40);

    if (compute_grade >= 75.00) {
        result = true;
    }
    else {
        result = false;
    }

    switch(result) {

     case   true : cout << "\nThe Student Passed the Subject.";
                   break;
      case   false : cout << "\nThe Student Failed the Subject.";
                     break;
      default      : cout << "Sorry Invalid Grade !!!";
    }
     return(compute_grade);
 }

 void start()
 {

     cout << "\t\t GRADE SOLVER VERSION 1.0 USING POINTERS";
     cout << "\n\n\t       Created By: Mr. Jake R. Pomperada, MAED-IT";
     cout << "\n\n";
     cout << "Enter Prelim Grade  ==> ";
     cin >> X_Prelim;
     cout << "Enter Midterm Grade ==> ";
     cin >> X_Midterm;
     cout << "Enter Endterm Grade ==> ";
     cin >> X_Endterm;
     cout << "\n";
     cout << fixed;
     cout << setprecision(2);
     cout << "\nYour Final Grade is " <<
          solve_grade(&X_Prelim,&X_Midterm,&X_Endterm) << ".";

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

main() {

    start();
}


Total Sum of Values in Turbo Pascal

Here is a sample program using one dimensional array to ask the user to give five numbers and then our program will compute the total sum of the five numbers being given by our user. I am using Turbo Pascal for Windows as my Pascal compiler in this sample program.

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

{Written By: Mr. Jake R. Pomperada, MAED-IT }
{Date : March 19, 2017    Sunday            }
{Metro Manila, Philippines                  }
{jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program One_Dimensional;
Uses WinCrt;

Type

List_Array = Array[1..5] of Integer;

var val : List_Array;

    b,sum   : Integer;

Begin
clrscr;
 writeln('TOTAL SUM OF VALUES IN PASCAL');
 writeln;
 for b := 1 to 5 Do
  Begin
     Write('Give value in item no. ' ,b, ' : ');
     Readln(val[b]);
  End;
 Writeln;
 Write('List of Given Values');
 Writeln;
 Writeln;
   for b := 1 to 5 Do
  Begin
    Write(' ',val[b],' ');
    sum := sum + val[b];
  End;
 writeln;
 writeln;
 write('The total sum of values is ' ,sum,'.');
 writeln;
 Writeln;
 writeln('  END OF PROGRAM  ');
readln;
End.



One Dimensional Array in Turbo Pascal

In this article I would like to share with you a sample program that will demonstrate how to use one dimensional array using Pascal as our programming language. What does the program will do is to ask the user to give five numbers and then our program will display the list of five numbers given by our user. The code is very simple and easy to understand. I am using Turbo Pascal for Windows as my pascal compiler in this sample program.

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

{Written By: Mr. Jake R. Pomperada, MAED-IT }
{Date : March 19, 2017    Sunday            }
{Metro Manila, Philippines                  }
{jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program One_Dimensional;
Uses WinCrt;

Type

List_Array = Array[1..6] of Integer;

var val : List_Array;

    b   : Integer;

Begin
clrscr;
 writeln('ONE DIMENSIONAL IN PASCAL');
 writeln;
 for b := 1 to 5 Do
  Begin
     Write('Give value in item no. ' ,b, ' : ');
     Readln(val[b]);
  End;
 Writeln;
 Write('List of Given Values');
 Writeln;
   for b := 1 to 5 Do
  Begin
    Write(' ',val[b],' ');
  End;
 writeln;
 Writeln;
 writeln('  END OF PROGRAM  ');
readln;
End.



Friday, March 17, 2017

Yard To Feet Converter in Turbo Pascal

Here is a sample program that will ask the user to give a value in yard and then our program will convert the given value in yard into feet equivalent using Pascal as our programming language. I use a function to do the conversion from yard to feet by multiplying the value in yard by 3 because 1 yard is equivalent to 3 feet. 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

Program yard_feet_converter;
Uses WinCrt;

var val_1, solve : integer;

Function convert_feet(a : integer) : integer;
Begin
   convert_feet := (a*3);
End;


Begin
clrscr;
 writeln('YARD TO FEET CONVERTER IN PASCAL');
 writeln;
 Write('Give a value in yard : ');
 Readln(val_1);

 solve:= convert_feet(val_1);

 writeln;
 write('The equivalent value of ' ,val_1, ' yard is ',solve,' feet(s).');
 writeln;
 writeln;
 writeln('  END OF PROGRAM  ');
readln;
End.




Sum of Three Numbers in Pascal

In this article I would like to share with you a sample program that I wrote using Pascal as my programming language that will ask the user to give three numbers and then our program will compute the total sum of three numbers using functions in Pascal. The compiler that I am using in this sample program is Turbo Pascal For Windows. The code is very simple and easy to understand.

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

Program Sum_Number;
Uses WinCrt;

var val_1,val_2,val_3, add : integer;

Function sum(a,b,c : integer) : integer;
Begin
   sum := (a+b+c);
End;


Begin
clrscr;
 writeln('SUM OF THREE NUMBERS IN PASCAL');
 writeln;
 Write('Enter First Number : ');
 Readln(val_1);

 Write('Enter Second Number : ');
 Readln(val_2);

 Write('Enter Third Number  : ');
 Readln(val_3);
   
 add := sum(val_1,val_2,val_3);

 writeln;
 write('The sum of ',val_1,' ',val_2, ' and ',val_3, ' is ' ,add,'.');
 writeln;
 writeln;
 writeln('  END OF PROGRAM  ');
readln;
End.