Showing posts with label age checker in turbo pascal. Show all posts
Showing posts with label age checker in turbo pascal. Show all posts

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.

Saturday, August 6, 2016

Age Checker in Pascal

In this article I would like to share with you a sample program that I wrote in Pascal to check if the given age of the user is already considered as an Adult or still a minor. I am using Turbo Pascal 5.0 as my compiler in this sample program.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Sample Program Output


Program Listing

Program Age;
Uses Crt;

Var Age_User  : Integer;

Begin
  Clrscr;
  Write('Age Checker in Pascal');
  writeln;
  writeln;
  Write('What is your age? ');
  readln(Age_User);

  if (Age_User >=18) then
    Begin
    Writeln;
    Writeln(Age_User, ' years old. You are already an Adult.');
    End
  else
     Begin
     Writeln;
     Writeln(Age_User, ' years old. You are still a Minor.');
     End;
  Readln;
End.