Thursday, June 26, 2014

Inventory System in PHP and MySQL

One of the most commonly used business application software is called Inventory System. This type of software was designed primarily to monitor the in and outs of products, it also designed to generated reports and inform the user how many products left in the storage so the they can make an order again to replenish the product in their stock room for example.

This simple inventory system will show you the name of the product, the quantity, the individual cost and the total cost. It also sum up all the cost of all products from the database. I just wrote this code just to learn how to perform computation of values in the fields in the table without using looping statements just like For loop I'm just using SQL commands to accomplish the task. One of the things that I have discovered is the SQL statements are very easy to use and can accomplish most business operations and simple calculations with ease.

I am using PHP and MySQL as my tools in creating this Inventory System application this is not yet a complete application there are still many things that can improve I just want to show everyone how to make this application with a few commands in PHP and MySQL. I hope you will find my work useful in your programming projects in the future.

Thank you very much.

Sample Output of our Program


Program Listing

<?php
// Written By: Mr. Jake R. Pomperada, MAED-IT
// Date : June 26, 2014
// PHP and MySQL

$con=mysqli_connect("localhost","root","","values");

if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT * , val_1 * val_2 AS  'total' FROM solve");
echo "\n\n";
echo "<table border='1'>
<tr>
<th align='center'>Product Name</th>
<th align='center'>Price</th>
<th align='center'>Quantity</th>
<th align='center'>Total Cost</th>
</tr>";

while($row = mysqli_fetch_array($result)) {
  echo "<tr>";
  echo "<td align='center'>" . $row['prod_name'] . "</td>";
  echo "<td align='center'>" . $row['val_1'] . "</td>";
  echo "<td align='center'>" . $row['val_2'] . "</td>";
  echo "<td align='center'> " . $row['total'] . "</td>";
  echo "</tr>";
}
echo "</table>";
$result_sum = mysqli_query($con,"SELECT * , SUM(val_1*val_2) AS  'total_sum' FROM solve");
echo "\n\n";
while($row = mysqli_fetch_array($result_sum)) {

echo "<h2> Total Cost  => Php ";

$solve = $row['total_sum'];
echo  number_format($solve,2);
echo "</h2";

}
mysqli_close($con);
?>



Friday, June 20, 2014

Odd and Even Numbers Generator in C++


One of the basic programming problem that is always given to students in programming is how to determine if the given number is an odd or even number. To check if the given number is even number is very simple a number should not have an remainder on the other hard and odd number has a remainder.

For example of odd numbers are 1,3,5,7,9,11 and even numbers are 2,4,6,8,10,12,14. In this example I will show you how to write a program to list down the numbers that are odd and even numbers. Our program will ask the user to enter 10 numbers and then our program will display the numbers that belongs to the even and odd numbers. In this sample program I am using C++ as my programming language. I hope you will find my work useful in your learning how to programming in C++.

Thank you very much.


Sample Output of Our Program


Program Listing

#include <iostream>
#include <stdlib.h>

using namespace std;


  main() {

      int b[10],mod=0;
      int *mypointer;

          cout << "\t<===================================>";
          cout << "\n\t    Odd and Even Numbers Generator";
          cout << "\n\t<===================================>";
          cout << "\n\n";

           mypointer = b;

           for (int z=0; z < 10; z+=1) {
               cout << "Enter Value No. " << z+1 << ": ";
               cin >> mypointer[z];
           }
           cout << "\n \t Odd Numbers";
          cout << "\n\n";
           for (int z=0; z < 10; z+=1) {
               mod = mypointer[z] % 2;
             if (mod != 0) {
                 cout << " " << mypointer[z] << " ";
             }
           }
           cout << "\n\n";
           cout << "\n \t Even Numbers";
           cout << "\n\n";
          for (int z=0; z < 10; z+=1) {
              mod = mypointer[z] % 2;
             if (mod == 0) {
                 cout << " " << mypointer[z] << " ";
             }
          }
         cout << "\n\n";
         system("pause");
       }



Wednesday, June 18, 2014

Triangle Image in C


In this article I will show you how to write a program using C as your programming language to show an image of an triangle. We can accomplish this by using three for looping statement to repeat the display of the asterisk symbol over our screen. The code is very simple to understand and easy to learn from it I hope you will find my work useful.

Thank you very much.



Sample Output of Our Program

Program Listing

#include <stdio.h>
#include  <stdlib.h>

main()
{

int a=0,b=0,c=0,n=15;

printf("\n\n");
printf("\t  TRIANGLE");
printf("\n\n");

for(a=1;a<=n;a++)

      {

              for(c=1;c<=n-a;c++)

              {

                      printf(" ");

              }

              for(b=1;b<=(2*a)-1;b++)

              {

                      printf("*");

              }

              printf("\n");

      }
printf("\n\n");
system("pause");

}





Friday, June 13, 2014

Bubble Sort in C++

Arranging of numbers are one of the strength of computer by using programming language we were able to make our work much faster, easier and more accurate compared before using the manual operations of arranging a series of numbers. There are many sorting algorithms developed to improve the efficiency of arranging of numbers or words. One of the most versatile sorting algorithm is called bubble sort, this sorting algorithm is very simple to use it will compare all the given numbers and then compare each one of them until such time the biggest numbers are being arrange at the highest position in a given list by the user for instance.

In this article I would like to share with you my simple program that uses bubble sort algorithm to sort a series of numbers given by the user. I create a bubble sort function to take the series of numbers I store each numbers using one dimensional array and then compare its values in our bubble sort function. The function itself will first display the original arrangement of number provided earlier by our user. When we run our program our program will ask the user how many numbers is to process afterwards our program will ask the user to enter a series of numbers.

After the user enter the last number our program will immediately display the original value provided by our user and then display a series of after pass of value it shows how the values is being sorted line by line until it reaches the final sorted list of numbers. I also added a feature of our program that ask the user if he or she wants to run the program again to give another list of values to be sorted by our program.

I hope you will find my work useful in learning how to implement bubble sort using C++ as your programming language.

Thank you very much.



Sample Output of Our Program


Code:Blocks the text editor that I used to write this Bubble Sort Program.

Program Listing

#include <iostream>
#include <iomanip>
#include <stdlib.h>

using namespace std;

void bubble_sort(int [],int);
int main()
{
    int items[30],numbers=0,i=0;
    char reply;
    do {
     system("cls");
     cout << "\t ===== Bubble Sort Program =====";
     cout << "\n\n";
     cout << "How many items to be process : ";
     cin >> numbers;

     for(i=0;i<numbers;i++) {
     cout << "Enter element item no. " << i+1 << " : ";
     cin >>items[i];
     }
     bubble_sort(items,numbers);
  cout << "Do you want to continue y/n : ";
    cin >> reply;
    if (toupper(reply) == 'N') {
        cout << "\n\n";
        cout << "\t\t Thank You For Using This Software !!!";
        cout << "\n\n";
        break;
    }
    } while (toupper(reply!='Y'));
}

void bubble_sort(int a[],int n)
{
int i=0,j=0,k=0,temp=0;
   cout << "\n";
   cout << "Unsorted List of Values ";
   cout << "\n\n";
    for(k=0;k<n;k++)
         cout << setw(5) <<a[k];
         cout << "\n\n";
    for(i=1;i< n;i++)
    {
         for(j=0;j< n-1;j++)
         if(a[j]>a[j+1])
               {
               temp=a[j];
               a[j]=a[j+1];
               a[j+1]=temp;
               }
    cout << "After Pass Number  : " <<i<< " :=> ";
        for(k=0;k< n;k++)
            cout << setw(5) <<a[k];
            cout << "\n\n";
    }
}








Search a Number in C++

There are many ways to write a program using a particular programming language just like C++ but the question is how we can construct a program without properly identity the nature of the problem. In this article I will show you how to write a program using C++ as our programming language to search a number in a given list by our user.

I called this program search a number using C++ what the program will do is very simple it will ask the user how many numbers to be process by our program. For example let say the user type 5 it means there are five items to be accepted by our program. Assuming that the five items has a value of 1,2,3,4,5 and then our program will ask again our user what number to be search. If our user give 3 our program will look in the list if the number 3 is found in the given list. Our program will tell our user that the number 3 is in the list and its location can be found at number three.

I hope you  will find my program useful enough in your programming assignments and projects.

Thank you very much.


This is the output if the given number is found in a given list.


This is the output if the given number is not found in a given list.


I am using Code:Blocks as my text editor in writing this program.


Program Listing

#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
{
 int a[30],x=0,number=0,i=0;


system("cls");
cout << "====== Searching a Number =====";
cout << "\n\n";
cout <<"Enter many items :";
cin >> number;
cout << "\n";

for(i=0;i < number;i++)
{
cout << "Enter a number in item no. " << i+1 << " : ";
cin >> a[i];
}
cout << "\n\n";
cout <<"Enter the number to be search :=> ";
cin >> x;

i=0;
while(i < number && x!=a[i])
i++;

if(i < number)
{
cout << "\n\n";
cout <<"The number " <<x<<" found at the location = " <<i+1 << ".";
}
else
{
cout << "\n\n";
cout <<"The number " << x << " not found in a given list.";
}

cout << "\n\n";
system("pause");
}







Thursday, June 5, 2014

Keypress in Javascript

Being a freelance software engineer and web developer I must able to learn many programming techniques and tricks to improve myself and become more confident enough to handle programming projects of my clients. One of the interesting scripting language that caught in my interest is the JavaScript. This scripting language used primarily for the client side as a tool for form validation to ensure that the user gives right value or select correct options before the information send to the server side.

JavaScript is used also for animations and timer in most web applications it can integrate in HTML,CSS,PHP,ASP.NET,ColdFusion,ASP,PERL,CGI and other web technologies with ease. At present time there are many JavaScript framework that is freely available over the Internet to name as few we have the very popular one JQuery, Node.Js, AngularJS that add functionality in our webpages and websites.

Let us go with our sample program this program will ask the user to enter five numbers and then it will return the sum of the five numbers. What is good about this program is that the user just press the enter key and the cursor will move to the next text field automatically without using the mouse to navigate through text field.

I hope you will find my work useful thank you very much.



Sample Output of Our Program

Program Listing

<html>
<style>
p.margin
{
margin-top:10px;
margin-bottom:35px;
margin-right:350px;
margin-left:335px;
}
</style>
<script>

// June 5, 2014 Thursday
// Written By: Mr. Jake Rodrgiuez Pomperada, MAED-IT
// Email Address : jakerpomperada@yahoo.com  / jakerpomperada@gmail.com
// FaceBook Address: jakerpomperada@yahoo.com
// Product of the Philippines.


function enter_key(next_textfield) {
if(window.event && window.event.keyCode == 13) {
  next_textfield.focus();
  return false; 
  }
else
  return true; 
  }

   function add_all() {
    var a = parseInt(document.getElementById("no1").value);
    var b = parseInt(document.getElementById("no2").value);
var c = parseInt(document.getElementById("no3").value);
    var d = parseInt(document.getElementById("no4").value);
    var e = parseInt(document.getElementById("no5").value);
    
 var total_sum = (a + b + c + d + e);
 document.getElementById("test").innerHTML
   = "<p class='margin'>The total sum is " +total_sum + ".</p>";
}
function clear_all()
{
document.getElementById("no1").value="";
document.getElementById("no2").value="";
document.getElementById("no3").value="";
document.getElementById("no4").value="";
document.getElementById("no5").value="";
document.getElementById("test").innerHTML = "";
document.getElementById("no1").focus();
}
  </script>
<body bgcolor="yellow">
<font size="5" face="comic sans ms">
<br>
<h2> <center> Key Press Demonstration in Javascript 
</center> </h2>

<form name="test">
<p class="margin">
Item No. 1: <input type="text" id="no1" name="field1"
 onkeypress="return enter_key(document.test.field2)"><br>
Item No. 2 <input type="text" id="no2" name="field2"
 onkeypress="return enter_key(document.test.field3)"><br>
Item No. 3 <input type="text" id="no3" name="field3"
 onkeypress="return enter_key(document.test.field4)"><br>
Item No. 4 <input type="text" id="no4" name="field4"
 onkeypress="return enter_key(document.test.field5)"><br>
Item No. 5 <input type="text" id="no5" name="field5"
 onkeypress="return enter_key(document.test.send)"><br>
<br>

   <input id="send" type="button" value="ADD SUM"
    title="Click here to find the sum of numbers"
   onclick="add_all();" />
  <input id="clear" type="button" value="CLEAR"
    title="Click here to clear the all the text field."
   onclick="clear_all();" />
   <p id="test"></p> 
 </font> </p>
</form>
</body>
</html>








Multiplication Table Creator

One of my favorite programming language to write a program and play around in C++ programming language it is a very versatile programming language you can write different kinds of applications from systems application to business applications. What I learned in C++ give me confidence to learn much easier other programming language like C#,Java and PHP because there any many similarities in these programming languages is also based in C++.

In this article I will show you how to create a multiplication table creator in C++. This program will ask the user to enter first the row value and then the column value and our program will generate the multiplication table on our screen. Actually the program is very simple and easy to understand the code is very short. I wrote a function to generate the multiplication I called the function mul_table. The logic of our program is the use of nested for loop statement, I also used setw statement that can be found in the use of a C++ library file called #include <iomanip> it is mean input and output manipulator used primarily for text formatting in C++.


int mul_table(int row, int column)
 {
  cout << "\n\n";
  cout << "\t  MULTIPLICATION TABLE";
  cout << "\n\n";
  for (int x=1; x<=row; x++) {
         cout << "\n";
        for (int y=1; y<=column; y++) {
         cout << setw(5) << x * y;

        }
    }
 }

I hope you will find my work useful thank you very much.



Sample Output of Our Program


Code::Blocks text editor that I used in writing this program


Program Listing

// multiplication table creator
// Written by: Mr Jake R. Pomperada, MAED-IT
// Tools : Code:Blocks and Dev C++
// June 5, 2014 Thursday


#include <iostream>
#include <iomanip>

 using namespace std;

int mul_table(int row, int column);


 int mul_table(int row, int column)
 {
  cout << "\n\n";
  cout << "\t  MULTIPLICATION TABLE";
  cout << "\n\n";
  for (int x=1; x<=row; x++) {
         cout << "\n";
        for (int y=1; y<=column; y++) {
         cout << setw(5) << x * y;

        }
    }
 }

main() {
    int numbers[2];
    cout << "\t Multiplication Table Creator ";
    cout << "\n\n";
    cout << "Enter Row Number    :=> ";
    cin >> numbers[0];
    cout << "Enter Column Number :=> ";
    cin >> numbers[1];
    mul_table(numbers[0], numbers[1]);
    cout << "\n\n";
    system("pause");
}






Celsius To Fahrenheit Conversion


One of the basic programming problems that is given by teachers in computer programming is conversion of values in this example we have Celsius To Fahrenheit Conversion that I wrote using Python as our programming language. This program is very simple I just wrote it to learn the fundamental concepts of Python programming language and also to share this code for individuals and beginners that are interested in Python programming.

The formula to convert Celsius to Fahrenheit is (Celsius * 1.8) + 32 the Celsius here is the value that is given by our user of our program multiplied by 1.8 after we add the value 32 to get the converted results to Fahrenheit.

Below is a function in Python that I wrote to convert Celsius To Fahrenheit.

def  convert_to_celsius(celsius):
  solve = (celsius * 1.8) + 32
  print("Temperature is Celsius is {:.2f}".format(solve));
  return



Sample Output of Our Program


Python Integrated Programming Environment


Program Listing

# Celsius To Fahrenheit Converter
# Written By: Mr. Jake R. Pomperada, MAED-IT
# Tools : Python
# Date  : June 5, 2014 Thurday

def  convert_to_celsius(celsius):
  solve = (celsius * 1.8) + 32
  print("Temperature is Celsius is {:.2f}".format(solve));
  return

print("\n")
print("@==================================@")
print("     Celsius To Fahrenheit Converter     ")
print("@==================================@")

complete = False
while complete == False:
 print("");
 temp = float(input("Kindly Enter Temperature in Celsius :=> "))
 print("");
 convert_to_celsius(temp);
 print("")

 choice = input("Are You Finish?  Y/N: ").lower().strip()

 if choice == "y":
      complete = True
 else:
      print("")

print("\n")
print("Thank You For Using This Program.")
print("\n")       






Wednesday, June 4, 2014

Factorial of a Number in Python


Recently I am trying to learn how to program in Python programming language one of the most programming problem is called Factorial of a Number. In factorial we refer to a number that is the product of all the integers from 1 to the the number given by our user. For example the factorial of 5! is 1*2*3*4*5 is equal to 120. When we talk about integer will refer this to a series of numbers that are whole number, negative,zero and positive number. Factorial numbers is not defined for negative number and zero will always gives you 1 as your value.

In this program I have written a simple factorial function to return factorial value result to the user of our program. As we can see in this function factorial we have one passing parameter we named it number and then an assignment statement solve_results which has an initial value of 1. We are also using for loop statement to perform the repetition of our commands and finally we have the solve_results that perform summation of values and it returns the computed value of our program.

def factorial(number):
    solve_results = 1
    for i in range(2, number + 1):
        solve_results *= i
    return solve_results
  

Sample Output of Our Program


Python Integrated Programming Environment

Program Listing

# Factorial of a Number 
# Written By: Mr. Jake R. Pomperada, MAED-IT
# Tools : Python
# Date  : June 4, 2014 Wednesday

def factorial(number):
    solve_results = 1
    for i in range(2, number + 1):
        solve_results *= i
    return solve_results
  
complete = False

while complete == False:

  print("@==================================@")
  print("      Factorial of a Number     ")
  print("@==================================@")
  print("");
  value = int(input("Kindly Enter a Number :=> "))
  print("");
  if value < 0:
    print("Sorry, factorial does not exist for negative numbers")
  elif value == 0:
    print("The factorial of 0 is 1")
  else:
    print("The factorial of",value,"is",factorial(value))
    print("")
  choice = input("Are You Finish?  Y/N: ").lower().strip()

  if choice == "y":
         complete = True
  else:
       print("")
  print("\n")
  print("Thank You For Using This Program.")
  



Tuesday, June 3, 2014

Fahrenheit To Celsius Converter in Python


In this article I will share with you a sample program that I wrote using Python programming language I called this program Fahrenheit To Celsius Converter in Python. I have already written this type of program in other programming languages in Visual Basic 6, Visaul Basic NET,C, C++, Java and PHP. I would like to try to convert the code using in Python in this program I wrote a function to solve and convert the temperature given in Fahrenheit into its Celsius equivalent. To find the Celsius temperature we are using this formula (°F - 32) x 5/9 = °C.

def  convert_to_celsius(fahrenheit):
  celsius = (fahrenheit - 32) * 5.0/9.0
  print("Temperature is Celsius is {:.2f}".format(celsius));
  return

Function in Python to solve the Celsius temperature equivalent

I hope you find my work useful and Thank you very much.



Sample Output of Our Program


Python Integrated Programming Environment


Program Listing

# Fahrenheit To Celsius Converter
# Written By: Mr. Jake R. Pomperada, MAED-IT
# Tools : Python
# Date  : June 3, 2014 Monday

def  convert_to_celsius(fahrenheit):
  celsius = (fahrenheit - 32) * 5.0/9.0
  print("Temperature is Celsius is {:.2f}".format(celsius));
  return

print("\n")
print("@==================================@")
print("  Fahrenheit To Celsius Converter     ")
print("@==================================@")

complete = False
while complete == False:
 print("");
 temp = int(input("Kindly Enter Temperature in Fahrenheit :=> "))
 print("");
 convert_to_celsius(temp);
 print("")

 choice = input("Are You Finish?  Y/N: ").lower().strip()

 if choice == "y":
      complete = True
 else:
      print("")

print("\n")
print("Thank You For Using This Program.")
print("\n")       






Login and Registration System in PHP and MySQL


For every websites in the Internet needs a form of security the most common security application that is being develop is login and registration system. Having a secured website is very important to insure that only the valid users are allowed to login and use the system. In this article I will show you how to create a login and registration system using PHP and MySQL.

This program is database driven we are using MySQL to save and retrieve the users records such information is the username,password, first name and last name of the user. One of the feature of the program is that I checks whether the username and password is already used by other user. I also added some features to validate invalid or erroneous values from our user. For the validation I use JavaScript to check for invalid entries and to minimize errors using the execution of our program. I also included an SQL dumb file for the creation of our database, tables and insertion of sample records.

I hope you will find my work useful in your programming projects and assignments using PHP and MySQL.

Thank you very much.




Sample Output of Our Program




Engine Monitoring System in PHP and MySQL

This application is written in PHP and MySQL designed to monitor the engine usage in a company. It monitors how many hours the engine runs. It is primarily for the maintenance of the engine in a factory or manufacturing firm. It also stores how many kilowatt hour being consumed by the engine.
This program has a menu for a navigation of the user. The first menu is to add records about the engine; it will store all the records in the database. The second navigation link is the view of records which allows the user of the system to view the list of dates, engine serial number, number of how the engine run and the kilowatt hour consume by the said engine. The third navigational link is for the search of record. In the search record the program will ask the user to enter the engine serial number to be search and the date it will search for the specific records that matched with the criteria given by the user.
The tools that I used in making this application are notepad++ that is free to download from the internet at http://notepad-plus-plus.org/. This editor is good in writing html, css, javascript, php and mysql codes. It is very user friendly and very easy to use. This editor is highly recommended for those beginners in web programming.
The PHP and MySQL compiler used is XAMPP that can be downloaded freely at http://www.apachefriends.org/en/xampp.html. Very nice PHP and MySQL compiler to be used the user interface is excelled to navigated. In terms of the web browser, I’m using Google chrome which is very good in testing your web pages and websites.
In using my code, once you download the code extract the code in the directory of xampp in htdocs and then create a database name engine at the phpmyadmin and then select the database named engine and then select import choose the sql dumb file named engine.sql and select go button. To create the table name records and insert a couple of records in the table.
After you have done that you are already to run the script, make sure you create a folder under htdocs, for example engine and put those downloaded file on it. In testing about this program in your web browser address bar type the following: let say http://localhost/engine/index.php it will run the index.php as your main menu of the system. But before you run make sure the XAMPP system is activated. I hope you will able to run successfully.
                      


Sample Output of Our Program



                    

Fahrenheit To Celsius Converter in Visual Basic NET

Software becomes the driving force of information technology at present time, most of us are very dependent on software in doing our day to day task or work.  For example if you are an office clerk your main job is to prepare the documents, worksheet and presentation for instance we need to use a complete application to do the work that we need. That's why we use Microsoft Office like ms work, ms excel and ms power point to do the job.  This software are very complex that it requires hundreds or even thousands of programmers to write this application. It also evolves many years of careful planning, design and development.  On the part of Microsoft Corporation they invest big amount of resources like money and facilities during the development of Microsoft Office applications before it will be released and sold in the market.

As a freelance developer I also encounter many challenging problems involving software design and development one of the most common problem is that the client or customer doesn't not have an adequate understanding about the real problem of their proposed information system that they are planning for me to developed. Another thing that I have observed once I was able to finish the system my client wants another features and changes for the system, if the changes related to my mistakes being a programmer I change it free from charge but if it related to features that are not included in an agreement that we have I charge them reasonable price for the services in programming.

In software design and development it is a must bust client and developer to set down and plan very well what are the needs, problems identified in the current system before the ball rolling in writing a code. Well organized planning will cut down the development time by half because the programmer can focus very well in solving the problem rather than thinking what are the additional problems to be solve in the proposed system whether the client needs a business application or system application this procedure is still applicable.  One of my close friend that is also a good application developer in Java told me during our college days solve first the problem before make some good design. I agree because once you solve the problem in algorithm it is easier for us to do the design.  I hope this advice that I shared with you will help you in your software development.


In this article I will discuss a simple program that I wrote in Microsoft Visual Basic .NET I called this program Fahrenheit To Celsius Solver. What this program will do is very simple it will ask the user to enter a value in Fahrenheit in our text box. By this time I gave the user the two option in solving the value of Celsius the first option is press the enter key and will give you the result in our label or the user can press the Solve Celsius button to get the result in the label in the form.  I also included a button to clear the label and the text box and finally the last button which enables the user to quit the program and return to our windows operating system. The code is very short and very easy to understand by beginning programmers in Visual Basic .NET.

Thank you very much.





Sample Output of Our Program

Program Listing

 Public Class frm_fahrenheit

    Private Sub txt_fahrenheit_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txt_fahrenheit.KeyPress
        If e.KeyChar = ControlChars.Cr Then 'Enter key
            lbl_result.Text = "The temperature equivalent in Celsius is " & _
                ((CInt(txt_fahrenheit.Text) * 9) / 5) + 32 & " Cº."
        End If
    End Sub

  
    Private Sub btn_celsius_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_celsius.Click
        lbl_result.Text = "The temperature equivalent in Celsius is " & _
                ((CInt(txt_fahrenheit.Text) * 9) / 5) + 32 & " Cº."
    End Sub

    Private Sub btn_clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_clear.Click
        txt_fahrenheit.Clear()
        lbl_result.Text = " "
        txt_fahrenheit.Focus()
    End Sub

    Private Sub btn_quit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_quit.Click
        If MsgBox("Are you sure you want to quit?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Quit Program?") = MsgBoxResult.Yes Then
            Me.Hide()
        Else
            Me.Show()
            txt_fahrenheit.Clear()
            lbl_result.Text = " "
            txt_fahrenheit.Focus()
        End If
    End Sub
End Class





Monday, June 2, 2014

Address Book in PHP and MySQL

An address book is a program that store the information of a person like name, home address, telephone numbers, mobile numbers, email address or even social media address like in Twitter, FaceBook, Instagram and others. This program is very useful to track down the contacts of your friends, relatives much easier compared of using of manual record keeping.

As I started my learning how to program in PHP and MySQL I learned how to create this address book from scratch the code in this program that I wrote is very simple it is intended for beginners and novice that are new in database development in PHP and MySQL. I also include SQL dumb file for easier creation of database and tables.

By the way the PHP and MySQL that I used in the creation of this program I used XAMPP that is freely available over the Internet free from charge. The text editor that I used in writing the commands in PHP and MySQL I used Notepad++ an open source text editor that has a professional features for ease of use in application design and development.

Thank you very much.


Sample Output of Our Program