Saturday, October 8, 2016

Foot To Inch Solver in Delphi

A very simple program that I wrote in Borland International Delphi programming language that will ask the user to give a value in foot and then it will convert the given value into inch equivalent.

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

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

unit foot_to_inch;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    Label5: TLabel;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}


Var inch : real;


procedure TForm1.Button1Click(Sender: TObject);
begin
 inch:=strtoint(Edit1.text) * 12;
 label5.caption := Edit1.text + ' Foot is equivalent to '
                   +  FloatToStr(inch) + ' Inche(s).';
                   

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.text     :='';
label5.caption := '';
edit1.setfocus;
end;

end.


Square Root Solver in Delphi

Here is a simple program that I wrote in Delphi that will ask the user to give a number and then our program will convert the given number by the user into its square root equivalent.

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

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

unit squareroot;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    Label5: TLabel;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}


Var value : real;


procedure TForm1.Button1Click(Sender: TObject);
begin
 value:=sqrt(strtoint(Edit1.text));
 label5.caption := 'The Square Root Equivalent of '
           + Edit1.text +  ' is ' +  FloatToStr(value) + '.';
                   

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.text     :='';
label5.caption := '';
edit1.setfocus;
end;

end.

Reverse a Number in Delphi

I wrote a simple program in Delphi that will ask the user to give a series of number and then our program will reverse the arrangement of the given number by the user.

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

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

unit reverse;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    Label5: TLabel;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}


Var value : String;


function ReverseString(const s: string): string; 
var 
  i, len: Integer; 
begin
  len := Length(s);
  SetLength(Result, len); 
  for i := len downto 1 do 
  begin 
    Result[len - i + 1] := s[i]; 
  end; 
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
 value:=Edit1.text;
 label5.caption := 'The reversed equivalent is '
                   + ReverseString(value) + '.';

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
edit1.text     :='';
label5.caption := '';
edit1.setfocus;
end;

end.




Reverse a Number Using While Loop Using Turbo Pascal

A simple program that wrote using Turbo Pascal For Windows to accept a series of numbers and then our program will reverse the arrangement of the number being provided by the user.

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

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 Revese_Num_Using_while_loop;
Uses WinCrt;

Var
  N,R : Longint;
  
Begin
 Clrscr;
 Write('Reverse a Number Using While Loop Using Turbo Pascal');
 Writeln;
 Writeln;
 Writeln;
 Write('Give a Number : ');
 Readln(N);
 Writeln; Writeln;
 Write('The Reversed Number :==> ');

  While (N<>0) Do
     Begin
  R := N mod 10;
  Write(R);
  N := N Div 10;
End;
Writeln;
Writeln;
Write('End of Program');
Readln;
End.



Search a String To Another String in C

A simple program that I wrote to search a string or a word to another string using C language. The code is very simple and easy to understand.

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

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 <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>

int xstrsearch ( char *, char * ) ;
void show( ) ;

int main( )
{
char s1[ ] = "PomperadaJake" ;
char s2[ ] = "Jake" ;
int pos ;

system("cls");
printf("Search a String To Another String in C")
         printf("\n\n");
printf ( "String One: %s\n", s1 ) ;

printf ( "String Two: %s\n", s2 ) ;

pos = xstrsearch ( s1, s2 ) ;
printf ( "\nThe pattern string is found at position: %d\n", pos ) ;

getch( ) ;
}


int xstrsearch ( char * s1, char * s2 )
{
int i, j, k ;
int l1 = strlen ( s1 ) ;
int l2 = strlen ( s2 ) ;

for ( i = 0 ; i <= l1 - l2 ; i++ )
{
j = 0 ;
k = i ;
while ( ( s1[k] == s2[j] ) && ( j < l2 ) )
{
k++ ;
j++ ;
}
if ( j == l2 )
return i ;
}
return -1 ;
}

Friday, October 7, 2016

Square Root in Turbo Pascal

This simple program that I wrote using Turbo Pascal For Windows will accept integer number value from the user and then our program will convert the given number by the user to it's square root equivalent.

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

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 Square_Root;
Uses WinCrt;


Var   value_a : real;
      solve_sqrt : reAL;

Begin
  Clrscr;
  Write('Square Root Solver in Turbo Pascal');
  writeln;
  Writeln;
  Write('Give a Number : ');
  Readln(value_a);
  Writeln;
   solve_sqrt := sqrt(value_a);
  Write('The Square Root equivalent of ' ,round(value_a),
         ' is ' , round(solve_sqrt), '.');
  writeln;
  Writeln;
  write('End of Program');
  Writeln; Writeln; Writeln;
  Write('      Written By: Mr. Jake R. Pomperada,MAED-IT     ');
  Writeln;
  Readln;
End.



Absolute Value Solver in Turbo Pascal

A simple program that I wrote using Borland International Turbo Pascal For Windows to solve the absolute value of the given negative integer number by the user. The code is very simple and easy to understand.


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


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 Absolute_Value_Solver;

Uses WinCrt;


Var   value_a : integer;

Begin
  Clrscr;
  Write('Absolute Value Solver in Turbo Pascal');
  writeln;
  Writeln;
  Write('Give a Number : ');
  Readln(value_a);
  Writeln;
  Write('The absolute value of ',value_a,
        ' is ' , abs(value_a),'.');
  writeln;
  Writeln;
  write('End of Program');
  Writeln; Writeln; Writeln;
  Write('      Written By: Mr. Jake R. Pomperada,MAED-IT     ');
  Writeln;
  Readln;
End.


Interest Rate Calculator in JQuery

A very simple program that I wrote using JQuery as my JavaScript library to compute for the interest rate of the money being loaned by a customer.  The code is very easy to understand and use.

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

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

<html>
<head>
<title> Interest Calculator in JQuery </title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<style>
body {
 background-color:lightgreen;
 font-family: arial;
 font-size:15px;
 font-weight:bold;
 }

 .input_bold {
    font-weight: bold;
font-size:15px;
color: red;
}

.left {
    width: 15%;
    float: left;
    text-align: right;
}
.right {
    width: 50%;
    margin-left: 10px;
    float:left;
}

.header {
    width: 30%;
    float: left;
    text-align: right;
}

h4 {
text-align: center;
}
</style> 
<script>
$(document).ready(function(){

 $("#solve").click(function(){
   
  var amt = $("#amt").val();
  var interest = $("#interest").val();
  var years = $("#years").val();
  
   remarks = (amt*interest*years/100)
$("#results").val('$ ' + remarks.toFixed(2));
 });

   $("#clear").click(function(){

   $("#amt").val('');
   $("#interest").val('');
   $("#years").val('');
    $("#results").val('');
   $("#amt").focus();
    
  });
  
  
 });
  
 </script>
</head>
<body>
<form>
<br><br><br><br>
<div class="header">
<h3> Interest Calculator in JQuery </h3>
<h4>       Written By      </h4> 
<h3> Mr. Jake R. Pomperada, MAED-IT </h3> 
</div>
<br><br><br><br><br><br><br><br>
<div class="left">
Amount Loaned
</div>
<div class="right">
<input type="text" id="amt" size="10" autofocus/><br>
</div>
<br><br>
<div class="left">
Interest Rate 
</div>
<div class="right">
<input type="text" id="interest" size="10" /><br>
</div>
<br><br>
<div class="left">
How many years
</div>
<div class="right">
<input type="text" id="years" size="10" />
</div>
<br><br>
<br>
<div class="left">
The interest is 
</div>
<div class="right">
<input type="text" id="results" class="input_bold" size="30" readonly/><br>
</div>
<br><br><br><br>
<div class="left">
<button type= "button" id ="solve">Check </button>    
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<div class="right">
<button type= "button" id ="clear">Clear </button> 
<br>

</div>

</form>
</body>
</html>