Thursday, March 24, 2016

Function with Parameters in JavaScript

A simple program that I have written using JavaScript that will accept a name of a person and it will be display using alert message box in JavaScript using functions with parameters.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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



<html>
<body>
<script>

function myfunction(name)
{
 alert("Hello " + name + " How are you? ");
}
</script>
What is your name
<input type="text" value="" id="user" size="20">
<br><br>
<button onclick="myfunction(user.value)"> 
Ok </button>


</body>
</html>


Sunday, March 20, 2016

Addition of Five Numbers in C#

A simple program that I wrote using C# that will ask the user to give five numbers and then the program will find the total sum of five numbers given by the user. The code is very easy to understand and use.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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


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

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

        private void Form1_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
            ToolTip1.SetToolTip(this.button1, "Click here to find the sum of five numbers.");
            ToolTip1.SetToolTip(this.button2, "Click here to clear textbox.");
            label6.Visible = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int values1 = Convert.ToInt32(textBox1.Text);
            int values2 = Convert.ToInt32(textBox2.Text);
            int values3 = Convert.ToInt32(textBox3.Text);
            int values4 = Convert.ToInt32(textBox4.Text);
            int values5 = Convert.ToInt32(textBox5.Text);

            int total_sum = (values1+values2+values3+values4+values5);
            label6.Visible = true;
            label6.Text = "The sum of " + values1.ToString() + "," + values2.ToString() + ", " + " "
                        + values3.ToString() + ", " + values4.ToString() + " and " + values5.ToString() +
                        " is " + total_sum + ".";

        }

        private void button2_Click(object sender, EventArgs e)
        {
            label6.Text = "";
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
            textBox4.Text = "";
            textBox5.Text = "";
            textBox1.Focus();
        }
    }
}


Odd and Even Number Checker in C#

In this sample program I wrote using Microsoft C# it will ask the user to give a number and then our program will check and determine whether the given number is odd or even.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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

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

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

        private void Form1_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
            ToolTip1.SetToolTip(this.button1, "Click here to find out if number is ODD or EVEN number.");
            ToolTip1.SetToolTip(this.button2, "Click here to clear textbox.");
            label3.Visible = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int values = Convert.ToInt32(textBox1.Text);


           if (values % 2 == 0)
            {

                label3.Visible = true;
                label3.Text ="The number " + " " + values.ToString() + " is an EVEN number.";
            }
            else
            {
                label3.Visible = true;
                label3.Text = "The number " + " " + values.ToString() + " is an ODD number.";
            }
        }

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



Saturday, March 19, 2016

Student Information System in CodeIgniter

Here is a sample program that I wrote in CodeIgniter as very popular PHP framework that demostrate CRUD application I called this program Student Information System in CodeIgniter that will manage the contact information of the students like name, course, home address, telephone numbers and email address. I hope you will find my work useful in learning CodeIgniter.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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



Fibonacci Sequence in Python

A program that will ask the user to give an integer number value and then it will generate the corresponding fibonacci number using Python as my programming language.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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


def fibonacci_sequence(values):
  
   if values <= 1:
       return values
   else:
       return(fibonacci_sequence(values-1) + fibonacci_sequence(values-2))


print("-" * 30)
print(" FIBONACCI SEQUENCE PROGRAM ")
print("-" * 30)
items = int(input("Enter an Integer Number : "))


if items <= 0:
   print("Plese enter a positive integer")
else:
   print("The result is :")
   for a in range(items):
       print(fibonacci_sequence(a))
  




Multiplication Table in Python

A simple program that I wrote using Python as my programming language that will generate a multiplication table. The code is very short and easy to understand.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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

a = 1
print("-" * 60)
print("\t\t\t MULTIPLICATION TABLE ")
print("-" * 60)
while a < 13:
    n = 1
    while n <= 12:
        print("%4d" % (a * n), end=' ')
        n += 1
    print()
    a += 1
print("-" * 60)




Thursday, March 17, 2016

Celsius To Fahrenheit Converter Using Functions in Python

A program that I wrote using Python as my programming language that will ask the user to give a temperature value in Celsius and then it will convert it to Fahrenheit equivalent using functions in Python.


If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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

print("");
print("Celsius To Fahrenheit Converter");
print("");
celsius = input("Enter temperature in Celsius : ")
temp = int(celsius)

def find_fahrenheit(temp):   
    return ((9.0/5.0) * float(temp)+32)

print("");

get_result = find_fahrenheit(temp)
final_result = int((get_result * 100) + 0.5) /100.0

print("The temperature ", temp, " in Celsius "
      ,final_result,' in Fahrenheit.')
print("");
print("End of Program")
print("");



Fahrenheit To Celsius Converter Using Functions in Python

A program that I wrote using Python as my programming language that will ask the user to give a temperature value in Fahrenheit and then it will convert it to Celsius equivalent using functions in Python.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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

print("");
print("Fahrenheit To Celsius Converter");
print("");
fahrenheit = input("Enter temperature in Fahrenheit : ")
temp = int(fahrenheit)

def find_celsius(temp):   
    return (float(temp)-32) * 5.0/9.0

print("");

get_result = find_celsius(temp)
final_result = int((get_result * 100) + 0.5) /100.0

print("The temperature ", temp, " in Fahrenheit "
      ,final_result,' in Celsius.')
print("");
print("End of Program")
print("");





Average of Three Numbers in Python

A very simple program that I wrote using Python as my programming language that will ask the user to give three integer number and then our program will find the average of the three number previously given by our user. 

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

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

print("Average of Three Numbers");
print("");
val1 = input("Enter a first number  : ")
x = int(val1)
val2 = input("Enter a second number : ")
y = int(val2)
val3 = input("Enter a third number  : ")
z = int(val3)

average = (x+y+z) /3
ave = int((average * 100) + 0.5) /100.0
print("");
print("The average of ", x, ",", y," and ", z, " is ",ave,".")
print("");
print("End of Program")




Count Capital and Small Letters in Python

A program that I wrote using Python that will ask the user to give a word and then our program will count how many upper case and lower case letters can be found in the give word by the user. The code is very short and easy to understand.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Program Listing


print("");
print("Count Capital and Small Letters in a Word");
print("");
word = input("Kindly give a word : ")

print("No. of Capital Letters: ", sum(1 for a in word if a.isupper()))
print("No. of Lower Letters: ", sum(1 for a in word if a.islower()))
print("");
print("End of Program")
print("");

Feet To Centimeter Converter in Python

A simple program that will ask the user to give a value in feet and then it will convert it in centimeters equivalent using Python as our programming language.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

print("");
print("Feet To Centimeter Converter");
print("");
feet = input("How many feet(s) : ")
value = float(feet)

def find_centimeters(value):   
    return float(value)* 30.48


print("");

get_result = find_centimeters(value)
final_result = int((get_result * 100) + 0.5) /100.0

print("The equivalent value of ", value, " feet(s) in centimeters is "
      ,final_result,' centimeter(s).')
print("");
print("End of Program")
print("");

Square and Cube Root Solver in Python

A simple program that I wrote using Python as my programming language that will ask the user to give a number and then the program will compute for the square and cube root value of the give number by the user.

If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output



Program Listing


print("");
print("Square and Cube Root Solver");
print("");
val1 = input("Enter a number  : ")
a = int(val1)

def square(a):   
    return int(a) * int(a)

def cube_root(a):
    return int(a) * int(a) * int(a)

print("");

square_result = square(a)
cube_result = cube_root(a)

print("The square value of ", a, " is " ,square_result,'.')
print("The cube root value of ", a, " is " ,cube_result,'.')
print("");
print("End of Program")
print("");


Sunday, March 13, 2016

Palindrome Checker in C++

A computer has been around for us for a long period of time. We use computers is a wide range of applications such as in business, industry, education, entertainment, weather forecasting, military for example.  It makes our lives easier because most of the tedious task and difficult task is being done by the computer with the use of a computer program. As a programmer our work is very crucial and critical most of the time because we are dealing with important facts and figures all the time one small mistake it can cause tremendous amount of losses on the part of the company or even in an organization we are working with.

Computers at first is designed to perform computations during world war 2 but later years it has been used to manipulate other types of date such as words, sentences, phrase or even paragraphs. In this article I will explain and discuss in detailed one of the most basic string applications written in C++ programming language a program called Palindrome Checker. C++ is one of the most versatile programming language derive from the C language that is introduced in 1972 by Dr. Dennis Ritchie later one as the complexity in software development particularly in system programming. C++ is being developed by Dr. Bjarne Stroustrup to overcome some of the weak point of the C language in 1981 at AT and T laboratories in New Jersey.  The enhancement of C++ library it gives the language more suitable application not only limited in system programming. When we talking about system programming we are referring to writing programs that interacts to the computer hardware such examples is operating systems, compilers and interpreters, antivirus software and system tools to maintain the normal operation of our computers.

So the question is what is a palindrome well a palindrome it refers to word, sentences, phrases, numbers or string when we read it forward and backward the spelling and pronunciation is the same. Example of words that is palindrome by nature is ana, radar, ama, abba to name a few.  In this article in writing our C++ program I will be using CodeBlock text editor and Dev C++ that is already integrated in our CodeBlocks editor.  This two software is open source it means it is free to use and download over the Internet for your own personal use and commercial use also.  You can download CodeBlock in their web address http://www.codeblocks.org/ .

Let us presuming you have already downloaded and installed codeblocks in your computer. The first step is to open our editor and encode the C++ commands. In this program we declare to library file in C++ that standard iostream and string.h. The iostream is one of the very basic library file we use every time we write the C++ program it tells our compiler that we are allowed to use basic input and output commands in C++ such for example cout and cin commands. The next library file that I will discuss is the string.h this library file in C++ is used primarily to include string functions in our program in this program we use the strcpy, strcmpi and strrev functions. The strcpy is a function that will copy the first and second  string variable in our program. The second strcpy command will copy the variable word3 that will act as your temporary folder of a string and  we use the strrev this function will reverse the first string variable in our program. The next part is the use of the  check_same_string = strcmpi(word1,word3); this command tells use the check_same_string is our assignment operator that will hold the compared string of word1 and word3 variables.  In our condition in our program  if (check_same_string == 0) it means that is the both string word1 and word3 are the same they are considered as palindrome if not the word is not a palindrome. Below is the complete program listing of our palindrome checker program.


If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Sample Program Output


#include <iostream>
#include <string.h>

  using namespace std;


char word1[50],word2[50],word3[50];

int check_same_string=0;

main()
{
    system("cls");
    cout << "\n\n";
    cout << "  ***====Palindrome Checker ====***";
    cout << "\n\n";
    cout << "Enter a Word Please : ";
    gets(word1);
     strcpy(word2,word1);
     strcpy(word3,strrev(word2));
     check_same_string = strcmpi(word1,word3);
      if (check_same_string == 0)

        {
            cout << "\n\n";
            cout << "The word in reversed order is " << word3 << ". \n";
            cout << "It is a Palindrome.";
        }
      else {
            cout << "\n\n";
            cout << "The word in reversed order is " << word3 << ".\n";
            cout << "It is Not a Palindrome.";
        }
     cout << "\n\n\n";
     cout << "\t  Thank You For Using This Program";
     cout << "\n\n";
     system("pause");
}