Friday, October 20, 2017

Legal Age Checker Using Switch Statement in C#

I wrote this simple program in C# as an example for my upcoming book on C# programming what does the program will do is to check if the given age of the user is already an adult or not using switch statement in C#. The code is very easy to understand and use I hope you will find my work useful.

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

legal.cs

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

/* Legal Age Checker                                */
/* Author : Mr. Jake R. Pomperada, MAED-IT          */
/* Date   : November 20, 2016    Sunday 10:25 AM    */
/* Tool   : C#                                      */

namespace legal_age
{
    class legal_age
    {
        static void Main(string[] args)
        {
            string reply;
            int n = 0;
            int age = 0;

            do
            {
                Console.Clear();
                Console.Write("Legal Age Checker ");
                Console.Write("\n\n");
                Console.Write("Enter Your Age    : ");
                age = Convert.ToInt32(Console.ReadLine());

                switch(age) {
                    case 1: case 2: case 3:  case 4: case 5: case 6:
                    case 7: case 8: case 9:  case 10: case 11: case 12:
                    case 13: case 14:  case 15: case 16: case 17:
                    Console.Write("\n\n");
                    Console.WriteLine("At the age {0} you are still a Minor.", age);
                    break;
                    default:
                    Console.Write("\n\n");
                    Console.WriteLine("At the age {0} you are already an Adult.", age);
                   break;
                  }
                Console.Write("\n\n");
                Console.Write("Do You Want To Continue? Y/N : ");
                reply = Console.ReadLine();

                if (reply == "y" || reply == "Y")
                {
                    continue;
                }
                else if (reply == "n" || reply == "N")
                {
                    Console.Write("\n\n");
                    Console.Write("Thank You For Using This Software.");
                    Console.Write("\n\n");
                    break;
                }

            } while (n == 0);
            Console.ReadLine();
        }
    }
}

Divisible Number in C#

A simple program that I wrote using C# as my programming language to check if the given number is divisible or not.  I am using Mono as my C# compiler that is free to download over the Internet.

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

divisible.cs

using System;

namespace divisible
{
    class divisible
    {
        static void Main(string[] args)
        {
            int num=0;
Console.Clear();
Console.Write("\n\n");
Console.Write("Checking Number Divisibility");
Console.Write("\n\n");
            Console.Write("Enter Any Number :  ");
            num=Convert.ToInt32(Console.ReadLine());

if((num%5 == 0) && (num%11 == 0) )
{
Console.Write("\n\n");
Console.Write("Number is divisible by 5 and 11.");
}
    else
{
Console.Write("\n\n");
Console.Write("Number is not divisible by 5 and 11.");
}
      Console.Write("\n\n");
Console.Write("End of Program");
Console.Write("\n\n");
            Console.ReadLine();
        }
    }

}




Legal Age Checker in C#

I wrote this simple program in C# as an example for my upcoming book on C# programming what does the program will do is to check if the given age of the user is already an adult or not. The code is very easy to understand and use I hope you will find my work useful.

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

age.cs

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

namespace legal_age
{
    class legal_age
    {
        static void Main(string[] args)
        {
            string reply;
            int n = 0;
            int age = 0;
          
            do
            {
                Console.Clear();
                Console.Write("Legal Age Checker ");
                Console.Write("\n\n");
                Console.Write("Enter Your Age    : ");
                age = Convert.ToInt32(Console.ReadLine());

                if (age >= 18)
                {
                    Console.Write("\n\n");
                    Console.WriteLine("At the age {0} you are already an Adult.",age);
                }
                else
                {
                    Console.Write("\n\n");
                    Console.WriteLine("At the age {0} you are still a Minor.",age);
                }
                Console.Write("\n\n");
                Console.Write("Do You Want To Continue? Y/N : ");
                reply = Console.ReadLine();

                if (reply == "y" || reply == "Y")
                {
                    continue;
                }
                else if (reply == "n" || reply == "N")
                {
                    Console.Write("\n\n");
                    Console.Write("Thank You For Using This Software.");
                    Console.Write("\n\n");
                    break;
                }

            } while (n == 0);
            Console.ReadLine();
        }
    }
}



Monday, October 16, 2017

Factors of a Number in C++

A very simple program that I wrote using C++ that will ask the user to give a number and then our program will display the factors of the given number. The code is very short and easy to understand. I hope you will find my work useful. I am using CodeBlocks as my text editor and Dev C++ as my C++ compiler in writing this program. 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.

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






Sample Program Output


Program Listing

factors.cpp


#include <iostream>

using namespace std;

int main()
{
    int value_number=0, a=0;

    cout << "=================================================";
    cout << "\n\n";
    cout << "\t Factors of a Number in C++";
    cout << "\n\n";
    cout << "======= Created By Jake Pomperada, MAED-IT =======";
    cout << "\n\n";
    cout << "Give a number :";
    cin >> value_number;

    cout << "\n\n";
    cout << "The factors of " << value_number << ".";

    cout << "\n\n";


    for(a=1; a <= value_number; a++)
    {
        if (value_number % a == 0)
        {
            cout << " " << a << " ";
        }
    }
   cout << "\n\n";
   cout << "End of Program";
   cout << "\n\n";

}




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