Thursday, March 30, 2017

Old Age Checker in C++

A very simple program that I wrote in C++ way back in 2010 in my C++ programming class in college to check if the user is old enough I am using array as my data structure and if conditional statement in C++.

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;


struct item {

    string name[2];
    int age[2];
};

  main()
    {
      item child;
      cout << "\t\t Determine Old Age ";
      cout << "\n\n";

        for (int x=0; x<2; x++) {
            cin.ignore();
            cout << "\nEnter the Child's Name : ";
            getline(cin,child.name[x]);
            cout << "\nEnter the Child's Age  : ";
            cin >> child.age[x];
        }

             cout << "\n\n";
               if (child.age[0] > child.age[1]) {
                    cout << "\n\n";
                   cout << child.name[0] << " is much older compared to "
                    << child.name[1];

               }
               else {
                      cout << "\n\n";
                    cout << child.name[1] << " is much older compared to "
                    << child.name[0];
               }

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

Product Costing Calculator in C++

A very simple program that I wrote using C++ to solve the product cost this program is very useful in business day to day operations. 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;


struct item {

    string name,type;
    int quantity;
    float price;
};

main() {
     item product;
     float solve=0.00;
     cout << "\n\tProduct Description 1.0";
     cout << "\n\n";
     cout << "Enter Product Name         : ";
     getline(cin,product.name);
     cout << "Enter Product Description  : ";
     getline(cin,product.type);
     cout << "Enter Product Quantity     : ";
     cin >> product.quantity;
     cout << "Enter Product Price/Pcs    : ";
     cin >> product.price;

     solve = (product.quantity * product.price);

     cout << fixed << setprecision(2);

     cout << "\n  === Report ===";
     cout << "\n\n";
     cout << "\nProduct Name   : " << product.name;
     cout << "\nProduct Type   : " << product.type;
     cout << "\nQuantity       : " << product.quantity;
     cout << "\nPrice          : " << product.price;
     cout << "\n\n Total Cost  : $ " << solve;
     cout << "\n\n";
     system("pause");
}


Subtraction of Two Numbers in Turbo Pascal

A  very simple program that I wrote using Pascal to ask the user to give two numbers and then our program will find the difference between the two numbers based on the user given numbers. 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

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

Program subtract_numbers;

Uses WinCrt;

var a,b,difference : integer;

Begin
clrscr;
a:=0;
b:=0;
difference := 0;
 writeln;
 Writeln;
 writeln('SUBTRACTION OF TWO NUMBERS IN PASCAL');
 writeln;
 write('Give first number : ');
 readln(a);
 write('Give second number : ');
 readln(b);

 difference := (a-b);
 writeln;
 write('The difference between ' ,a, ' and ' ,b,' is ' ,difference,'.');
 writeln;
 Writeln;
 writeln('END OF PROGRAM');
readln;
End.


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.