Wednesday, October 5, 2016

Remove Consonants in JavaScript

A very simple script that I wrote in JavaScript that will ask the user to give a word or a sentence then our program will remove the consonants in the given word or sentence.

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>
    <title>Remove Consonants</title>
    <style type="text/css">
    .formLayout
    {
        font-family:arial;
    size:14px;
    background-color: lightgreen;
        border: solid 2px #a1a1a1;
        padding: 30px;
        width: 250px;
    }

    .formLayout label, .formLayout input

    {
        display: block;
        width: 250px;
        float: left;
        margin-bottom: 20px;
    }


 .formLayout label
    {
        text-align: left;

    }
    br
    {
        clear: left;
    }
    </style>
</head>
<body>
<script language="JavaScript">
function execute_program(){
var inputStr=document.form_vowel.strings_remove.value;
var result = Remove_Consonants_Str(inputStr);
document.form_vowel.answer.value = result;
}
 
function Remove_Consonants_Str(str) {
  return str.replace(/[BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz]/gi, '');
}

</script>
<div class="formLayout">
<form name=form_vowel>
<h4>Remove Consonants </h4>
<label>Enter a Word or String </label>
<input type="text" name="strings_remove" size=15>
<label>The Result  </label>
<input type="text" name="answer"  readonly="readonly" size=15><br>
<input type="button" value="Remove" onClick='execute_program()'>
</form>
</div>
</body>
</html>


Remove Vowels in JavaScript

A very simple script that I wrote in JavaScript that will ask the user to give a word or a sentence then our program will remove the vowels in the given word or sentence.

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>
    <title>Remove Vowels</title>
    <style type="text/css">
    .formLayout
    {
        font-family:arial;
    size:14px;
    background-color: lightgreen;
        border: solid 2px #a1a1a1;
        padding: 30px;
        width: 250px;
    }

    .formLayout label, .formLayout input

    {
        display: block;
        width: 250px;
        float: left;
        margin-bottom: 20px;
    }


 .formLayout label
    {
        text-align: left;

    }
    br
    {
        clear: left;
    }
    </style>
</head>
<body>
<script language="JavaScript">
function execute_program(){
var inputStr=document.form_vowel.strings_remove.value;
var result = Remove_Vowels_Str(inputStr);
document.form_vowel.answer.value = result;
}

function Remove_Vowels_Str(str) {
  return str.replace(/[aeiouAEIOU]/gi, '');
}

</script>
<div class="formLayout">
<form name=form_vowel>
<h4>Remove Vowels </h4>
<label>Enter a Word or String </label>
<input type="text" name="strings_remove" size=15>
<label>The Result  </label>
<input type="text" name="answer"  readonly="readonly" size=15><br>
<input type="button" value="Remove" onClick='execute_program()'>
</form>
</div>
</body>
</html>

Positive and Negative Number Checker in JQuery

Here is a very simple program that I wrote using JQuery that will ask the user to give a number and then our program will check and determine whether the given number is a positive number or negative number 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


<html>
<head>
<title> Positive or Negative Number Checker in JQuery </title>
<script src="jquery.js"></script>
<style>
body {
 font-family: arial;
 font-size:15px;
 font-weight:bold;
 }

 .input_bold {
    font-weight: bold;
font-size:15px;
color: red;
}
</style> 
<script>
$(document).ready(function(){

 $("#check_it").click(function(){
  var num = $("#num_value").val();

  if(jQuery.isNumeric(num) == false){
        alert('Please enter numeric value');
$('#num_value').val('');
$("#results").val('');
        $('#num_value').focus();
     }
  else if (num>= 0)
{
remarks = num+ " is a Positive Number.";
$("#results").val(remarks);
}
  else {
remarks = num+ " is a Negative Number.";
$("#results").val(remarks);
      }
 });

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

   $("#num_value").val('');
   $("#results").val('');
   $("#num_value").focus();
    
  });
  
  
 });


 </script>
</head>
<body>
<form>
Give a Number
<input type="text" id="num_value" size="3"autofocus/><br><br>

The result
<input type="text" id="results" class="input_bold" size="30" readonly/><br>
<br><br>
<button type= "button" id ="check_it">Check </button>    
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button type= "button" id ="clear">Clear </button>    
</form>
</body>
</html>

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");
}