Saturday, December 17, 2016

Celsius To Fahrenheit in Visual Basic NET

Here is a simple program that I wrote using Visual Basic NET to ask the user to give temperature in Celsius and then our program will convert the temperature given into Fahrenheit equivalent. I wrote this code before to Visual Basic 6 I try to migrate my codes into Visual Basic NET version. I hope you will find my work useful. Thank you.

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 compute_fahrenheit As Double
        compute_fahrenheit = (9 / 5) * (Val(TextBox1.Text) + 32)
        Label2.Text = "The Fahreneheit is " & Format(compute_fahrenheit, "0.00")
    End Sub

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

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim result As DialogResult = MessageBox.Show("Do you want to quit?", _
                               "Quit Program", _
                               MessageBoxButtons.YesNo)

        If (result = DialogResult.Yes) Then
            End
        Else
            TextBox1.Text = ""
            Label2.Text = ""
            TextBox1.Focus()
        End If
    End Sub
End Class





List of Odd Numbers Using Methods in C#

In this article I would like to share with you a sample program that I wrote using methods in C# to list down the odd numbers from 250. This code will help you understand how to write a method and use of looping statement for in C# 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.



Sample Program Output


Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/* List of Odd Numbers Using Methods                */
/* Author : Mr. Jake R. Pomperada, MAED-IT           */
/* Date   : December 1, 2016    Thursday 11:20 AM    */
/* Tool   : C#                                      */

namespace list_odd_numbers
{

    class list_odd_numbers
    {
       // Method Check_Odd_Numbers

        public static bool Check_Odd_Numbers(int  value)
        {
            return value % 2 != 0;
        }

          static void Main(string[] args)
            {
            

            Console.Write("\n\n");
            Console.Write("\t\t LIST OF ODD NUMBERS USING METHODS ");
            Console.Write("\n\n");
            for (int a = 0; a <= 250; a++)
            {
                if (Check_Odd_Numbers(a))
                {
                    Console.Write(" {0} ",a);
                }
            }

            Console.Write("\n\n\n");
            Console.Write("\t\t Thank You For Using This Software.");
            Console.Write("\n\n");
            Console.ReadLine();
        }
    }
}




Sunday, December 11, 2016

Product of Two Numbers Using Visual Basic NET

Here is a simple program that I wrote that will ask the user to give a  number and then our program will find the product of the numbers using Visual Basic NET. 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.





Program Sample Output


Program Listing

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim product As Integer
        product = Val(TextBox1.Text) * Val(TextBox2.Text)
        Label3.Text = "The Product of " & TextBox1.Text & " and " & TextBox2.Text & _
                      " is " & product & "."
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        End
    End Sub

End Class




Product of Two Numbers in Visual Basic 6

Here is a very simple program that I wrote using Microsoft Visual Basic 6 to ask the user to give two numbers and then our program will compute the product of the two numbers being provided by our user.

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 product_all
product_all = Val(Text1.Text) * Val(Text2.Text)
Label3.Caption = "The Product of " & Val(Text1.Text) & " and " & Val(Text2.Text) & _
                 " is " & product_all & "."
End Sub

Private Sub Command2_Click()
End
End Sub



Kilograms To Pounds Converter in JavaScipt

Here is a sample program that will ask the user to give weight in kilograms and then convert in pounds using JavaScript. 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>
<title> Kilograms To Pounds Converter 1.0
</title>
<body bgcolor="lightblue">
<font color="black" face="Arial" size="5">
<center>
<br>
    Kilograms To Pounds Converter 1.0
<br>
</center>
</font>
<style type="text/css">
.labelText {
 text-align : right;
 padding-right : 3px;
 color   : black;
 font-family:"Arial";
 font-size    : 18px;
}
</style>

 <form  name="mass" method="post">
<table>
<tr>
<tr>
 <td> &nbsp; </td>
 </tr>
<td class="labelText">  Enter Weight in Kilograms

</td>
<td> <input type="text" name="kg"  size="10"/> </td>
</tr>

 <tr>
 <td> &nbsp; </td>
 </tr>
</td>
<tr>
<td class="labelText">
The result is
</td>
<td> 
<input type="text" name="display"  size="50"/> </td>
 </tr>
  <tr>
 <td> &nbsp; </td>
 </tr>
</td>                   
<td> <input type="button" value="Compute" 
title="Click here to compute the weight in pounds."
 onClick="compute1()">
</td> 
<td> <input type="button" value="Clear" 
title="Click here to clear the text box."
 onClick="clear_all()">
</td> 

</table>
</font>
</form>
<script language ="javascript">
function compute1()
{


var value1, solve1,final_result;
  
value1 = parseInt(document.mass.kg.value);
              
solve1 = (value1 * 2.2);
// For two decimal places convertion
 final_result = Math.round(solve1 * 100) /100;

text1=" kg = ";
text3=" kilograms multiplied by 2.2 = ";
text4=" pounds.";


result = value1 + text3 + final_result + text4; 
               

document.mass.display.value = result;
}

function clear_all()
{
document.mass.kg.value = "";
document.mass.display.value = "";
document.mass.kg.focus(); 
}
</script>
</body>
</html>


Product Cost Solver in JavaScript

In this article I would like to share with you a sample program to compute the cost of the product using JavaScript.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

<html>
<head>
<title> Product Cost 1.0
</title>
</title>
<body bgcolor="lightgreen">
<font color="Blue" face="Arial" size="5">
<center>
<br>
Product Cost Solver Version 1.0
<br>
</center>
</font>
<style type="text/css">
.labelText {
 text-align : right;
 padding-right : 3px;
}
</style>
<form  name="addval" method="post">
<font color="black" face="Arial" size="5">
<table>
<tr>
<td class="labelText"> <label for="val1"> Enter Product Name
</label></td>
<td> <input type="text" name="name"  size="40"/> </td>
</tr>
<tr>
<td class="labelText"> <label for="val2"> Enter Product Price
</label></td>
<td> <input type="text" name="price" size="20"/> </td>
</tr>
<tr>
<td class="labelText"> <label for="val3"> Enter Product Quantity
</label></td>
<td> <input type="text" name="quantity"  size="20"/> </td>
</tr>
 <tr>
 <td> &nbsp; </td>
<tr>
<td class="labelText"> <label for="sum"> Total Product Cost
</label></td>
<td> <input type="text" name="cost" size="20"/> </td>
</tr>
 <tr>
 <td> &nbsp; </td>
</tr>
<td> <input type="button" value="Compute Cost" 
name="btnSubmit" onClick="add()">
</td> 
<td> <input type="button" value="Clear Textbox" 
name="btnSubmit" onClick="clear_all()">
</td> 

</table>
</font>
</form>

<script language ="javascript">

function add()
{
var xval1, xval2, compute, final_result;
  
xval1 = parseFloat(document.addval.price.value);
xval2 = parseInt(document.addval.quantity.value);

compute = (xval1 * xval2);
// For two decimal places convertion
final_result = Math.round(compute * 100) /100;

document.addval.cost.value = "Php " +final_result;
}

function clear_all()
{
document.addval.name.value = "";
document.addval.price.value = "";
document.addval.quantity.value = "";
document.addval.cost.value = "";
document.addval.name.focus(); 
}
</script>


</body>
</html>





Palindrome Checker in JavaScript

In this article I wrote in JavaScript that will ask the user to give a string or a word and then the program will check and determine if the given word or string is a palindrome or not a palindrome.

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>
<body bgcolor="yellow">

<script type="text/javascript">
  function Palindrome() {
   var revStr = "";
   var str = document.getElementById("str").value;
   var i = str.length;
   for(var j=i; j>=0; j--) {
      revStr = revStr+str.charAt(j);
   }
   if(str == revStr) {
      alert(str.toUpperCase() + " is Palindrome");
   } else {
      alert(str.toUpperCase() + " is not a Palindrome");
   }
}
</script>
<font color="blue" size="6">
 <center>
Palindrome Checker 1.0 <br>
<font size="3">
Created By <br>
Mr. Jake R. Pomperada, MAED-IT
</center>
 <br>
</font>

<form >
<font color="blue" size="4">
  Enter a Word or a Number: <input type="text" id="str" name="string" /><br />
  <br>
  <input type="submit" value="Check For Palindrome" onclick="Palindrome();"/>
</font>
</form>

</body>
</html>





Odd and Even Number Checker in JavaScript

Here is a program that I wrote using JS or JavaScript to ask the user to give a number then our program will check and determine if the given number is ODD and EVEN number.  

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>
<body bgcolor="gray">

<script type="text/javascript">
  function odd_even() {
   
   var val = document.getElementById("num").value;
     n = parseInt(val);
if (isNaN(n))
{
alert("Please Enter a Number");
}
else if (n == 0)
{
alert("The number is zero");
}
else if (n%2)
{
alert("The number is odd");
}
else
{
alert("The number is even");
}
}
</script>
<font color="white" size="6">
 <center>
Odd And Even Number Checker 1.0 <br>
<font size="3">
Created By <br>
Mr. Jake R. Pomperada, MAED-IT
</center>
 <br>
</font>

<form >
<font color="white" size="4">
  Please Enter a Number <input type="text" id="num" name="number" /><br />
  <br>
  <input type="submit" value="Check Number" onclick="odd_even();"/>
</font>
</form>

</body>
</html>





Fahrenheit To Celsius Converter in JavaScript

Here is a sample program that I wrote in JavaScript that will ask the user to give temperature in Fahrenheit and then convert into Celsius equivalent.  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

<html>
<title> Fahrenheit To Celsius Converter 1.0
</title>
<body bgcolor="lightblue">
<font color="black" face="Arial" size="5">
<center>
<br>
 Fahrenheit To Celsius Converter 1.0
<br>
</center>
</font>
<style type="text/css">
.labelText {
 text-align : right;
 padding-right : 3px;
 color   : black;
 font-family:"Arial";
 font-size    : 18px;
}
</style>

 <form  name="temp" method="post">
<table>
<tr>
<tr>
 <td> &nbsp; </td>
 </tr>
<td class="labelText">  Enter Temperature in Fahrenheit

</td>
<td> <input type="text" name="fahr"  size="10"/> </td>
</tr>

 <tr>
 <td> &nbsp; </td>
 </tr>
</td>
<tr>
<td class="labelText">
The result is
</td>
<td> 
<input type="text" name="display"  size="50"/> </td>
 </tr>
  <tr>
 <td> &nbsp; </td>
 </tr>
</td>                   
<td> <input type="button" value="Compute" 
title="Click here to compute the temperature in celsius."
 onClick="compute1()">
</td> 
<td> <input type="button" value="Clear" 
title="Click here to clear the text box."
 onClick="clear_all()">
</td> 

</table>
</font>
</form>
<script language ="javascript">
function compute1()
{
var xval1, solve1,final_result;
var result;
  
value1 = parseInt(document.temp.fahr.value);
              
solve1 = 100/(212-32) * (value1 - 32 )
// For two decimal places convertion
 final_result = Math.round(solve1 * 100) /100;

result = value1 + " fahrenheit is equivalent to " 
               + final_result + " celsius. ";

document.temp.display.value = result;
}

function clear_all()
{
document.temp.fahr.value = "";
document.temp.display.value = "";
document.temp.fahr.focus(); 
}
</script>
</body>
</html>