Wednesday, October 5, 2016

Greet Me in Jquery

A simple script that I wrote using JQuery that will ask the user's name and then our program will say Hello How are you to the user. It shows how to accept input values such as string and display using JQuery as our JavaScript library.

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

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("form").submit(function(){
        var names=  document.getElementById("fname").value;
        alert("Hello " + names + "How are you?");
    });
});
</script>
</head>
<body>

<form action="">
What is your name <input type="text" id="fname" name="FirstName" value=""><br>

  <input type="submit" value="Submit">
</form>

</body>
</html>

Saturday, October 1, 2016

Positive and Negative Number Checker in Delphi

A simple program that I wrote using Delphi as my programming language that will ask the user to give a number and then our program will check and determine whether the given number from the user is a positive or negative number. The code is very short and very 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

positive_negative_numbers.pas

unit positive_negative_numbers;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.DFM}

var number_value : integer;

procedure TForm1.Button1Click(Sender: TObject);
begin
     number_value := StrToInt(Edit1.Text);

     if (number_value >=0) then
      Begin
         label2.Caption :=  'The Give Number ' + IntToStr(number_value)
                 + ' is a Positive Number.';
      end
      else
         Begin
             label2.Caption :=  'The Give Number ' + IntToStr(number_value)
                 + ' is a Negative Number.';
         end;

end;

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

end.









Addition of Three Numbers in Visual Basic





This is my second video tutorial for Youtube

Positive and Negative Number Checker in Visual Basic

A simple program that I wrote using Microsoft Visual Basic 5 to check if the given integer number by our user is a positive or negative number. The program 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

Private Sub Command1_Click()

number_value = Val(Text1.Text)

If (number_value >= 0) Then
  Label4.Caption = "The given number " & number_value & " is a Positive Number."
Else
    Label4.Caption = "The given number " & number_value & " is a Negative Number."
End If
  
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Label4.Caption = " "
End Sub





Addition of Two Numbers in C++

Wednesday, September 28, 2016

Area of the Rectangle Solver in Visual Basic

Here is a very simple program that I wrote using Visual Basic 5 to compute the area of the rectangle. The code is very short and easy to understand. What does the program will do is to ask the user to give  length and breath of the rectangle and the our program will solve for it's area.

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


Private Sub Command1_Click()

   Sum = Val(Form1.Text1.Text) * Val(Form1.Text2.Text)

   Label4.Caption = "The are of the rectagle is " & Sum & "."

End Sub

Private Sub Command2_Click()

   Form1.Text1.Text = ""
   Form1.Text2.Text = ""
   Form1.Label4.Caption = ""
   Form1.Text1.SetFocus

End Sub





Area of Rectangle in Delphi

Here is a sample program that I wrote using Delphi as my programming language that will compute the area of the rectangle. The code is very short 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

rectangle.pas

unit rectangle;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

  Var length : integer;
  Var    breadth : integer;
  Var   compute_all : integer;

procedure TForm1.Button1Click(Sender: TObject);
begin
      length := StrToInt(Edit1.Text);
      breadth := StrToInt(Edit2.Text);

      compute_all := (length * breadth);

      label4.Caption :=  'The Area of the Rectangle is '
            + IntToStr(compute_all) + '.';

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text     := '';
Edit2.Text     := '';
Label4.Caption :='';
Edit1.Setfocus;
end;

end.




Monday, September 26, 2016

Interest Rate Solver in Text File in C++

A simple program that I wrote a long time ago in C++ that will compute the interest rate of the amount being loaned and then save the results in a text file.

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


My mobile number here in the Philippines is 09173084360.


Program Listing

#include <iostream>
#include <iomanip>
#include <fstream>


using namespace std;

main() {

    string name;

    int principal=0;
    int number_months=0;
    float rate=0.00,solve_rate=0.00;

    ofstream file("report.txt");

    cout << "\t  Kwarta Agad Lending Investor";
    cout << "\n\n";
    cout << "Enter Customer Name    :=> ";
    getline(cin,name);
    cout << "\nEnter Amount  Loan   :=> ";
    cin >> principal;
    cout << "\nNumber of Months    :=> ";
    cin >> number_months;
    cout << "\nEnter Rate Per Month :=> ";
    cin >> rate;
    solve_rate = (principal * number_months * rate ) ;
    cout << "\n\n";
    cout << fixed << setprecision(2);
    cout << "The Simple Interest Rate is Php "
         << solve_rate << ".";

    file << "\n\t ======= Kwarta Agad Lending Investor =========";
    file << "\n\n";
    file << "\n\t\t CUSTOMER REPORT";
    file << "\n\n";
    file << "\n Customer Name     : " << name;
    file << "\n Amount   Loan     : " << principal;
    file << "\n Number of Months  : " << number_months;
    file << "\n Rate Per Month    : " << rate;
    file << "\n\n";
    file << fixed << setprecision(2);
    file << "\n Interest Rate is Php " << solve_rate;
    file.close();
    cout << "\n\n";
    system("pause");
}

Roman Numeral To Decimal in PERL

A simple program that I wrote using PERL as my programming language that will ask the user to give roman numeral value and then our program will convert the given roman numeral value into it's decimal equivalent in PERL.

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


My mobile number here in the Philippines is 09173084360.


Program Listing

#!D:\xampp\perl\bin

our @EXPORT = qw(isroman arabic Roman roman);

our %roman2arabic = qw(I 1 V 5 X 10 L 50 C 100 D 500 M 1000);

starting();

sub isroman($) {
    my $arg = shift;
    $arg ne '' and
      $arg =~ /^(?: M{0,3})
                (?: D?C{0,3} | C[DM])
                (?: L?X{0,3} | X[LC])
                (?: V?I{0,3} | I[VX])$/ix;
}

sub arabic($) {
    my $arg = shift;
    isroman $arg or return undef;
    my($last_digit) = 1000;
    my($arabic);
    foreach (split(//, uc $arg)) {
        my($digit) = $roman2arabic{$_};
        $arabic -= 2 * $last_digit if $last_digit < $digit;
        $arabic += ($last_digit = $digit);
    }
    $arabic;
}
sub starting {
        print "\n\n";
        print "\t Roman Numeral To Decimal in PERL.";
        print "\n\n";
        print "Enter a Roman Numeral : ";
        chomp($a=<>);
        print "\n\n";
        print "The roman numeral $a equivalent is ";
        print uc(arabic($a));
        print ".";
        print "\n\n";
        print "Do you want to continue (Y or N) ? : ";
        chomp($choice=<>);
        if( $choice eq "y") {
            goto &starting;
          } else {
            print "\n\n";
            print "\t End of Program";
            print "\n";
            exit;

        }
 }

Decimal To Roman Numeral in PERL

A simple program that I wrote using PERL as my programming language that will ask the user to give decimal value and then our program will convert the given decimal value into roman numeral equivalent in PERL.

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


My mobile number here in the Philippines is 09173084360.


Program Listing

#!D:\xampp\perl\bin

my %roman_digit = qw(1 IV 10 XL 100 CD 1000 MMMMMM);
my @figure = reverse sort keys %roman_digit;
$roman_digit{$_} = [split(//, $roman_digit{$_}, 2)] foreach @figure;

starting();

sub Roman($) {
    my $arg = shift;
    0 < $arg and $arg < 4000 or return undef;
    my($x, $roman);
    foreach (@figure) {
        my($digit, $i, $v) = (int($arg / $_), @{$roman_digit{$_}});
        if (1 <= $digit and $digit <= 3) {
            $roman .= $i x $digit;
        } elsif ($digit == 4) {
            $roman .= "$i$v";
        } elsif ($digit == 5) {
            $roman .= $v;
        } elsif (6 <= $digit and $digit <= 8) {
            $roman .= $v . $i x ($digit - 5);
        } elsif ($digit == 9) {
            $roman .= "$i$x";
        }
        $arg -= $digit * $_;
        $x = $i;
    }
    $roman;
}

sub roman($) {
    lc Roman shift;
}

sub starting {
        print "\n\n";
        print "\t Decimal To Roman Numeral in PERL.";
        print "\n\n";
        print "Enter a number : ";
        chomp($a=<>);
        print "\n\n";
        print "The number $a it's roman numeral equivalent is ";
        print uc(roman($a));
        print ".";
        print "\n\n";
        print "Do you want to continue (Y or N) ? : ";
        chomp($choice=<>);
        if( $choice eq "y") {
            goto &starting;
          } else {
            print "\n\n";
            print "\t End of Program";
            print "\n";
            exit;

        }
 }