Thursday, October 12, 2017

Odd and Even Number Checker in ASP.NET

Hi there first of all thank you very much for visiting my website. I am very happy that the visitors of my website is growing everyday even though I did not earn any money from this endeavor but I would like to share my passion about programming.

In this article I would like to share with you a sample program that I wrote in Visual Basic NET and ASP.NET I called this program odd and even number checker in ASP.NET. Programming in ASP.NET is very new to me because I am a PHP developer for a long period of time. I find it very easy to create a web application using my existing knowledge in Visual Basic.

What does the program will do is to ask the user to give a number and then our program will determine and check if the given number is odd or even number. The code is very simple and easy to understand. I am using Microsoft Visual Studio 2008 as my working environment in writing this code. I hope you will like my work.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.







Sample Program Output


Program Listing

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Odd and Even Number Checker in ASP.NET</title>
</head>
<style type="text/css">

body 
{
font-family:Arial;
background-color:lightgreen;
font-size:larger;
font-weight:bolder;
}

.blue_me 
{
font-family:Arial;
font-size:medium;
font-weight:bolder;
color:blue;
}

</style>

<body>
    <form id="form1" runat="server">
    <div>
    
        <br />
        Odd and Even Number Checker in ASP.NET</div>
<p class="blue_me">
    Created By Mr. Jake R. Pomperada, MAED-IT</p>
        Enter a number &nbsp;&nbsp;
        <asp:TextBox ID="TextBox1" runat="server" Font-Names="Arial" Font-Size="Medium"></asp:TextBox>
    <br />
    <br />
    <asp:Label ID="Label1" runat="server"></asp:Label>
    <p>
        <asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Size="Medium" 
            Text="Check" 
            
           
            ToolTip="Click here to determine if the given number is an odd or even." />
            &nbsp;&nbsp;&nbsp; 
        <asp:Button ID="Button2" runat="server" Font-Bold="True" Font-Size="Medium" 
            Text="Clear" 
            ToolTip="Click here to clear the textbox and label." />
    </p>
    <p>
        &nbsp;</p>
    </form>

</body>
</html>


Default.aspx.vb


Partial Class _Default
    Inherits System.Web.UI.Page

    Function IsOdd(ByVal iNum As Integer) As Boolean
        IsOdd = ((iNum \ 2) * 2 <> iNum)
    End Function

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

        If TextBox1.Text = "" Then
            MsgBox("Cannot be empty")
            TextBox1.Text = ""
            Label1.Text = ""
            TextBox1.Focus()
            Exit Sub
        End If

        If IsOdd(Val(TextBox1.Text)) = True Then
            Label1.Text = "The given number " & TextBox1.Text & " is an ODD number."
        Else
            Label1.Text = "The given number " & TextBox1.Text & " is an EVEN number."
        End If

    End Sub

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






Tuesday, October 10, 2017

Odd and Even Number Checker in C

Here is a simple program that I wrote using C language to ask the user to give a number and then our program will check and determine if the given number is odd or even. I am using CodeBlocks as my text editor and Dev C++ as my C compiler which is freely available to download over the Internet. I hope you like my work. Thank you.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

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


#include <stdio.h>

int main()
{
    int val=0;


    printf("Odd and Even Number Checker in C");
    printf("\n\n");

    printf("Enter a number : ");
    scanf("%d", &val);


    if(val % 2 == 0) {
        printf("\n\n");
        printf("The given number %d is an EVEN number.",val);
    }
    else {
        printf("\n\n");
        printf("The given number %d is an ODD number.",val);
    }
        printf("\n\n");
        printf("End of Program");
        printf("\n\n");
}



Odd and Even Number Checker in Visual Basic

In this article I would like to share with you a sample program that will ask the user to give a number and then our program will check if the given number is an odd or even number using Visual Basic. I also included a function to check if the text box is empty and it will display a message box to give a warning to our user. The code is very simple and easy to understand. I hope you will find my work useful. Thank you.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

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


Function IsOdd(ByVal iNum As Integer) As Boolean
    IsOdd = ((iNum \ 2) * 2 <> iNum)
End Function

Private Sub Command1_Click()

If Text1.Text = "" Then
MsgBox ("Cannot be empty")
Text1.Text = ""
Label1.Caption = ""
Text1.SetFocus
Exit Sub
End If

If IsOdd(Val(Text1.Text)) = True Then
Label1.Caption = "The given number " & Text1.Text & " is an ODD number."
Else
Label1.Caption = "The given number " & Text1.Text & " is an EVEN number."
End If

End Sub

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

Private Sub Command3_Click()
End
End Sub




Saturday, October 7, 2017

Remove Vowels in Visual Basic

In this article I would like to share with you this program that I wrote using Microsoft Visual Basic 5 to require our user to give a string or sentence and then our program will remove the vowels from it. I hope you will find my work useful. Thank you.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

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 x As Integer
    Dim str1 As String
    
    str1 = Text1.Text
        
    For x = 1 To Len(UCase(str1))
     a = Mid(str1, x, 1)
      Select Case UCase(a)
   Case "A", "E", "I", "O", "U"
      str1 = Left(str1, x - 1) & " " & Right(str1, (Len(str1) - x))
   Case Else
      
   End Select
Next x
       
  Label2.Caption = "The remaining string is " & str1 & "."
End Sub

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

Private Sub Command3_Click()
End
End Sub




Count Vowels in Visual Basic

Hi there in this article I would like to share with you a sample program that I wrote using Microsoft Visual Basic 5 to ask the user to give a string or a sentence and then our program will count the number of vowels in the give string or sentence by our user. The code is very short and easy to understand. I hope you will learn from this one. Thank you.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

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


Const vowels = "aeiou"

Private Function Count_All_Vowels(strText As String) As Integer
    Dim i As Integer
    For i = 1 To Len(strText)
        If InStr(1, vowels, Mid$(strText, i, 1), vbTextCompare) Then
            Count_All_Vowels = Count_All_Vowels + 1
        End If
    Next i
End Function



Private Sub Command1_Click()
    Label2.Caption = "Total Number of Vowels is  " & Count_All_Vowels(LCase(Text1.Text)) & "."
End Sub

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

Private Sub Command3_Click()
End
End Sub





Saturday, September 30, 2017

Palindrome Checker in ASP.NET

Here is a simple program that I wrote that will ask the user to give a string and then our program will check if the given string is a Palindrome or Not a Palindrome using VB.NET as my programming language and ASP.NET as my web development SDK framework. I hope you will find my work useful. Thank you.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

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

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Palindrome Checker in ASP.NET</title>
</head>
<style type="text/css">
    p 
 {
  font-family:Arial;
  font-size:16px;
  color:Blue;
  font-weight:bold;
        width: 672px;
    }

 body 
 {
  font-family:Arial;
  font-size:14px;
  color:Blue;
  font-weight:bold;
  background-color:Lime;
  }

</style>

<body>
    <form id="form1" runat="server">
    <br />
    <p align="center">
        Palindrome Checker in ASP.NET <br /><br/>
        Created By Mr. Jake R. Pomperada, MAED-IT
        </p>
    <p align="center">
        &nbsp;</p>
<p align="left">
        Give a String&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TextBox1" runat="server" Width="193px"></asp:TextBox>
        </p>
<asp:Button ID="Button1" runat="server" Text="Check" align="center" 
        ToolTip="Click here to check if the given string is a palindrome."/>
&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button2" runat="server" Text="Clear" align="center" 
        ToolTip="Click here to clear the textbox."/>
    <br />
    <br />
    <br />
    <br />
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</form>
</body>
</html>


Default.aspx.vb

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim s1 As String
        Dim s2 As String

        Me.Label1.Visible = True

        s1 = Me.TextBox1.Text.ToLower
        s2 = StrReverse(s1)
        If (s1 = s2) Then
            Me.Label1.Text = "The given string  " + s1.ToUpper() + " is a Palindrome."
        Else
            Me.Label1.Text = "The given string " + s1.ToUpper() + " is Not a Palindrome."
        End If
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.Label1.Visible = False
    End Sub

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



Addition of Two Numbers Using ASP.NET

In this article I would like to share with you a sample program that I wrote using ASP.NET and VB.NET to compute the sum of the two numbers. Actually this is the first time I wrote an ASP.NET application in my entire programming career it is very easy to write one it only takes some dedication and patience to accomplish one. I hope you like my work. Thank you.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

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

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Addition of Two Numbers in ASP.NET</title>
</head>
<style>
  body 
  {
  background-color:lime;
  }
 </style>
<body>
    <form id="form1" runat="server">
    <div>
    
        <b>Addition of Two Numbers in ASP.NET<br />
        <br />
        Created By Mr. Jake R. Pomperada, MAED-IT</b><br />
    
    </div>
    <p>
        Enter First Number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;         <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </p>
    <p>
        Enter Second Number&nbsp;
        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    </p>
    <p>
        The sum is&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
    </p>
    <p>
        <asp:Button ID="Button1" runat="server" Text="Sum" 
            ToolTip="Click here to compute the sum of the two values." Width="75px" />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button2" runat="server" Text="Clear" 
            ToolTip="Click here to clear the text box." Width="80px" />
    </p>
    </form>
</body>
</html>

Default.aspx.vb

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.TextBox3.Text = Val(Me.TextBox1.Text) + Val(Me.TextBox2.Text)
    End Sub

    
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.TextBox1.Text = ""
        Me.TextBox2.Text = ""
        Me.TextBox3.Text = ""
        Me.TextBox1.Focus()
    End Sub
End Class






Friday, September 29, 2017

Decimal To Hexadecimal Converter in Java

A very simple program to ask the user to give a value in integer or decimal and then convert it into hexadecimal equivalent using Java as our programming language. The code is very easy to understand and use.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

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


Decimal_Hexa.java


import java.util.Scanner;

/**
 * @author Jake R. Pomperada
 * Bacolod City, Negros Occidental, Philippines
 * September 29, 2017  Friday    7:42 PM
*/


public class Decimal_Hexa {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int deci_values, rem, orig;
                String hexdecnum_values="";
        
Scanner input = new Scanner(System.in);
        
        char hexa_values[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
        
        System.out.print("\n\n");
System.out.print("===== Decimal To Hexadecimal Converter in Java ====");
System.out.print("\n\n");
System.out.print("===== Written By: Mr. Jake R. Pomperada =====");;
System.out.print("\n\n");
       
        System.out.print("Give Decimal Number : ");
        deci_values = input.nextInt();
        orig = deci_values;
        
        while(deci_values >0)
        {
            rem = deci_values % 16;
            hexdecnum_values = hexa_values[rem] + hexdecnum_values;
            deci_values /=16;
        }
        System.out.println();
        System.out.print("The Equivalent Hexadecimal Value of " + orig + " is ");
        System.out.print(hexdecnum_values + ".");
        System.out.print("\n\n");
System.out.println("END OF PROGRAM");
 System.out.println();
        input.close();

}

}