Friday, October 7, 2016

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>


Absolute Value Solver in Delphi

A simple program that I wrote using Borland International Delphi 7 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

unit abs;

interface

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

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Label3: TLabel;
    Button1: TButton;
    Label4: TLabel;
    Label5: TLabel;
    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_a,solve_a : integer;

procedure TForm1.Button1Click(Sender: TObject);
begin
     value_a := StrToInt(Edit1.Text);
     solve_a := (-value_a);
     Label3.Caption := 'The absolute value of ' + edit1.text
                  + ' is ' + inttostr(solve_a) + '.';

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text      :='';
Label3.Caption  :='';
Edit1.SetFocus;
end;

end.


Absolute Value Solver in C#

A simple program that I wrote using Microsoft Visual C#.NET 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

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int abs_value = 0, solve_abs=0;

            if (!int.TryParse(textBox1.Text, out abs_value))
            {
                MessageBox.Show("I need just a number in the textbox.");
                textBox1.Text = "";
                textBox1.Focus();
            }
            
            else
            {
                abs_value = Convert.ToInt32(textBox1.Text);
                solve_abs = Math.Abs(abs_value); label3.Text = "The absolute value of " 
                    + abs_value +" is " + solve_abs + ".";
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            label3.Text = " ";
            textBox1.Focus();
        }
    }
}






Absolute Value Solver in Visual Basic.NET

A simple program that I wrote using Microsoft Visual Basic.NET 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

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim value_a As Integer
        Dim solve_a As Integer

        value_a = Val(TextBox1.Text)

        solve_a = Math.Abs(value_a)

        Label3.Text = "The absolute value of " & value_a & " is " & solve_a & "."

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        Label3.Text = ""
        TextBox1.Focus()
    End Sub
End Class




Absolute Value Solver in Visual Basic

A simple program that I wrote using Microsoft Visual Basic 5 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

Private Sub Command1_Click()
Dim value_a As Integer

value_a = Abs(Val(Text1.Text))

Label3.Caption = "The absolute value of " & Text1.Text & _
                 " is " & value_a & "."
End Sub


Private Sub Command2_Click()
Text1.Text = ""
Text1.SetFocus
End Sub



Absolute Values Solver in JavaScript

Here is another simple program that I wrote in JavaScript that will ask the user to give a negative integer number and then our program will solve its is absolute value equivalent of the negative number. The code is very short and easy to understand among beginners in JavaScript programming.

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

<!DOCTYPE html>
<html>
<head>
    <title>Absolute Value Solver in JavaScript</title>
    <style type="text/css">
    .formLayout
    {
        font-family:arial;
size:14px;
background-color: #f3f3f3;
        border: solid 1px #a1a1a1;
        padding: 35px;
        width: 300px;
    }
    
    .formLayout label, .formLayout input 
    {
        display: block;
        width: 120px;
        float: left;
        margin-bottom: 20px;
    }
 
    .formLayout label
    {
        text-align: right;
        padding-right: 20px;
    }
 
 .formLayout label
    {
        text-align: right;
        padding-right: 20px;
    }
    br
    {
        clear: left;
    }
    </style>
</head>
<body>
<script language="JavaScript">
function Find_Absolute_Value(){
var inputNum=document.form_abs.number_value.value;
var result = Math.abs(inputNum);
document.form_abs.answer.value = result;
}
</script>
<div class="formLayout">
<form name=form_abs>
<h4> Absolute Value Solver in JavaScript</h4>
<label>Give a Number </label>
<input type="text" name="number_value" size=5>
<label>The Answer is </label>
<input type="text" name="answer" size=5><br>

<input type="button" value="Solve" onClick='Find_Absolute_Value()'>
</form>
</div>
</body>
</html>

Wednesday, October 5, 2016

Odd and Even Number Using Method in Java

A program that I wrote using Java that uses method to check if the given number is an odd or even. 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.


Program Listing

// Problem : Write a program in Java that will check if the given number by the user is an
//           Odd or Even Number.         
// Date:  June 28, 2015
// Written By: Mr. Jake R. Pomperada, MAED-IT
// Email Address: jakerpomperada@yahoo.com and jakerpomperada@gmail.com

import java.util.Scanner;


class odd_even_checker {
    public int check_odd_even_number(int value)
    {
      if((value % 2) == 0) 
System.out.println("The given number is " + value + " is Even Number.");
else
System.out.println("The given number is " + value +  " is Odd Number.");
    return 0;
    }

 
public static void main(String args[]) {
  Scanner scan = new Scanner(System.in);
   char a;
do
    {
  // creating of an object
  
  odd_even_checker num = new odd_even_checker();
      
  System.out.println();
  System.out.println("===== ODD OR EVEN NUMBER CHECKER =====");
  System.out.println();
  System.out.print("Enter a Number :  ");
  int number_given =   scan.nextInt();
  
  System.out.println();
     num.check_odd_even_number(number_given);
  System.out.println("\n\n");
  System.out.print("Do you Want To Continue (Y/N) :=> ");
   a=scan.next().charAt(0);

   } while(a=='Y'|| a=='y');
          System.out.println("\n");
          System.out.println("\t ===== END OF PROGRAM ======");
         System.out.println("\n");
 }
  
   } // End of Program




















Count Capital and Small Letters in JQuery

A simple program that I wrote that will ask the user to give a string or a word and then our program will count how many capital and small letters found in the word,string or sentence 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>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <title>Count Capital and Small Letters in JQuery</title>
         <style>
        body{
font-family:arial;
font-size:15px;
font-weight:bold;
}  
</style>
        <script>
  $(function(){
$("#count").click(function(){
if (document.getElementById("str").value == '') {
alert("Textbox is Empty !!! Please provide some string.");
document.getElementById("str").value = "";
document.getElementById("upper_str").value = "";
document.getElementById("lower_str").value = "";
document.getElementById("str").focus();
                        }
else {
var str1 = document.getElementById("str").value;
   var numUpper = str1.length - str1.replace(/[A-Z]/g, '').length;  
var numLower = str1.length - str1.replace(/[a-z]/g, '').length;  
                        var result = document.getElementById("upper_str");
var result2 = document.getElementById("lower_str");
                        result.value = numUpper;
result2.value = numLower;
}
       });
});
                   
            $(function(){    
$("#clear").click(function(){
document.getElementById("str").value = "";
   document.getElementById("upper_str").value = "";
   document.getElementById("lower_str").value = "";
   document.getElementById("str").focus();
});
});
        </script>
  </head>
  <body>
      <br><br>
      <h3>Count Capital and Small Letters in JQuery</h3>
  <br>
        Enter a String <input type="text" id="str" name="str" value="" size="30" autofocus/>
        <br><br>
        <input type="button" name="Submit"  id="count" value="Count" title="Click here to count the capital and small letters."/>
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" name="Submit" id="clear" value="Clear" title="Click here to clear the text box."/>
<br><br><br><br>
        Number of Capital Letter(s) is  <input type="text" id="upper_str" name="upper_str" size="3"/>
<br><br>
Number of Small Letter(s) is  <input type="text" id="lower_str" name="lower_str" size="3"/>
  </body>
</html>


Input and Output in Array in PERL

Here is a very short program that I wrote using PERL that will ask the user to give a series of  number store the given number by the user in array and display on the screen.

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

#!D:\xampp\perl\bin

my @arr;
my $count =5;

$a=1;
print "\n\n";
print "\t\t Input and Output of Array in PERL";
print "\n\n";
 for ($a..5) {
    print "Enter value in item no. $a : ";
    my $num = <STDIN>;
    chomp $num;
    push @arr, $num;
    $a+=1;
}


print "\n\n";
print "The List of Values";
print "\n\n";
foreach (@arr) {
  printf "\t %s\n", $_;
}
print "\n";
print "End of Program";
print "\n";

Highest and Lowest Number in PERL

Here is a sample program that will ask the give to give a series of integer number and then our program will check which of the given number by the user is the highest and lowest using PERL as my programming language.

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

#!D:\xampp\perl\bin

my @arr;
my $count =10;
my ($lowest, $highest);

$a=1;
print "\n\n";
print "\t\t Highest and Lowest Number in PERL";
print "\n\n";
 for ($a..10) {
    print "Enter value in item no. $a : ";
    my $num = <STDIN>;
    chomp $num;
    push @arr, $num;
    $a+=1;
}


for (@arr) {
    $lowest  = $_ if !$lowest || $_ < $lowest;
    $highest = $_ if !$highest || $_ > $highest;
};


print "\n\n";
print "Display Result";
print "\n\n";
#foreach (@arr) {
#  printf "%s\n", $_;
#}
print "The highest number is  $highest.\n";
print "\n";
print "The lowest number is $lowest.";