Saturday, December 17, 2016

Square and Cube Number Solver in C# Using Methods

Here is a sample program that I wrote using Microsoft C# programming language that will ask the user to give a number and then our program will compute the square and cube equivalent of the given number 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

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

/* Square and Cube Number Solver Using Methods        */
/* Author : Mr. Jake R. Pomperada, MAED-IT           */
/* Date   : December 3, 2016    Saturday 10:42 AM    */
/* Tool   : C#                                      */


namespace square_cube_number
{
    class square_cube_number
    {

        // Method Square a Number
        static public int square_number(int a)
        {
            return a * a;

        }

        // Method Cube a Number
        static public int cube_number(int a)
        {
            return a * a * a;

        }
        static void Main(string[] args)
        {
            int val_1 = 0;
            int solve_square = 0;
            int solve_cube = 0;

            Console.Write("\n\n");
            Console.Write("\t SQUARE AND CUBE NUMBER SOLVER USING METHODS ");
            Console.Write("\n\n");
            Console.Write("Give a Number :  ");
            val_1 = Convert.ToInt32(Console.ReadLine());

            solve_square = square_number(val_1);
            solve_cube = cube_number(val_1);
            
            Console.Write("\n\n");
            Console.Write("The given number is {0} it's square equivalent is {1}." ,val_1,solve_square);
            Console.Write("\n\n");
            Console.Write("The given number is {0} it's cube equivalent is {1}.", val_1, solve_cube);
            Console.Write("\n\n\n");
            Console.Write("Thank You For Using This Software.");
            Console.Write("\n\n");
            Console.ReadLine();
        }
    }
}






Area of the Circle in Visual Basic NET

Here is another simple program that I wrote using Microsoft Visual Basic NET to ask the user to give the radius of the circle and then our program will compute it's area based on the given radius value of the 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

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim compute_area_circle As Double
        compute_area_circle = (Val(TextBox1.Text) * Val(TextBox1.Text) * 3.1416)
        Label4.Text = "The Area of the Circle is " & Format(compute_area_circle, "0.00")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        Label4.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 = ""
            Label4.Text = ""
            TextBox1.Focus()
        End If
    End Sub

    
End Class





Inches To Centimeter Converter in Visual Basic NET

In this simple program it will ask the user to give value in inches and then our program will convert the given value into centimeters equivalent using Microsoft Visual Basic NET. The code is design for beginners like me in Visual Basic NET 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

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim compute_centimeter As Double
        compute_centimeter = (Val(TextBox1.Text) * 2.54)
        Label4.Text = "The Centimeter Equivalent is " & Format(compute_centimeter, "0.00")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        Label4.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 = ""
            Label4.Text = ""
            TextBox1.Focus()
        End If
    End Sub

    
End Class




US Dollar To Philippine Peso Converter in Visual Basic NET

Here is a simple program that I wrote using Microsoft Visual Basic NET to ask the user to give an amount in US Dollars and then it will convert into Philippine Peso equivalent. Let us assume that one US Dollar is equivalent to Php 45.50 in Philippine Pesos. The code is very easy to understand I started learning Visual Basic NET in my spare time.

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_peso As Double
        compute_peso = (Val(TextBox1.Text) * 45.5)
        Label4.Text = "The Philippine Peso Rate is Php " & Format(compute_peso, "0.00")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        Label4.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 = ""
            Label4.Text = ""
            TextBox1.Focus()
        End If
    End Sub

    
End Class







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>