Sunday, April 9, 2017

Reverse a Number Checker in Visual Basic NET

Here is a sample program that I wrote using Visual Basic NET to ask the user to give a number and then our program will reverse the arrangement of the number. The code is very short and easy to understand. 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 Listing

Program Listing

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim n As String

        n = TextBox1.Text
        Label2.Text = "The reverse arrangement of the number is " & n.AsEnumerable.Reverse.ToArray & "."

    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

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



Perfect Number Checker in Visual Basic NET

A very simple program that I wrote using Visual Basic NET to ask the user to give a number and then the program will check if the given number is a PERFECT number or NOT a PERFECT number. The code is very easy to understand and use. 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

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim n, sum, p, r As Integer

        n = Val(TextBox1.Text)
        p = 1
        sum = 0
        While p <= n \ 2
            r = n Mod p
            If r = 0 Then
                sum += p
            End If
            p += 1
        End While

        If sum = n Then
            Label2.Text = "The number " & n & " is a PERFECT Number."
        Else
            Label2.Text = "The number " & n & " is NOT a PERFECT Number."
        End If
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

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






Prime Number in Visual Basic NET

Here is a sample program that I wrote using Visual Basic NET to ask the user to give a number and then our program will check and determine if the given number is a prime number or not a prime number. 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

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim a, b As Integer
        Dim t As Boolean
        a = Val(TextBox1.Text)
        t = True
        For b = 2 To (a - 1)
            If a Mod b = 0 Then
                t = False
                Exit For
            End If
        Next b
        If t Then
            Label2.Text = "The number " & a & " is a PRIME Number."
        Else
            Label2.Text = "The number " & a & " is NOT a PRIME Number."
        End If
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

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


Odd and Even Number in Visual Basic NET

A very simple program that I wrote using Visual Basic NET to ask the user to give a number and then the program will check if the given number is an EVEN or ODD number. The code is very easy to understand and use. 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

Public Class Form1

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim val_me As Integer
        Dim isEven As Boolean
        val_me = Val(TextBox1.Text)
        If val_me Mod 2 = 0 Then
            isEven = True
            Label2.Text = "The number " & " " & val_me & " is an EVEN number" & "."
        Else
            Label2.Text = "The number " & " " & val_me & " " & "is an ODD number" & "."
        End If
    End Sub

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


Friday, April 7, 2017

Positive and Negative Number Checker in Visual Basic NET

Here is a sample program that will ask the user to give a number and then our program will determine and check if the given number is a positive or negative number. The code is written in Visual Basic NET I am using Visual Studio 2013 Ultimate Edition in writing this program. 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
 
Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If Val(TextBox1.Text) >= 0 Then
            Label2.Text = "The given nunber " & TextBox1.Text & " is a POSITIVE NUMBER" & "."
        Else
            Label2.Text = "The given nunber " & TextBox1.Text & " is a NEGATIVE NUMBER" & "."
        End If
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

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


 

Sum of Even Numbers in Visual Basic NET

Hi there 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 compute the total sum of all the even numbers in the given number value by our user using Visual Basic NET. The code is very simple and easy to understand. 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

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim sum As Integer
        If Val(TextBox1.Text) < 2 Then
            MsgBox("Invalid value !!! Try Again", vbCritical)
        Else
            For a = 2 To Val(TextBox1.Text) Step 2
                sum = sum + a
            Next a
            Label2.Text = "The sum of all even numbers from 1 to " & TextBox1.Text & ": " & sum & "."
        End If
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

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

Sum of All Odd Numbers in Visual Basic NET

Hi there 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 compute the total sum of all the odd numbers in the given number value by our user using Visual Basic NET. The code is very simple and easy to understand. 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

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim sum As Integer
        If Val(TextBox1.Text) < 0 Then
            MsgBox("Invalid value !!! Try Again", vbCritical)
        Else
            For a = 1 To Val(TextBox1.Text) Step 2
                sum = sum + a
            Next a
            Label2.Text = "The sum of all odd numbers from 1 to " & TextBox1.Text & ": " & sum & "."
        End If
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

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


Tuesday, April 4, 2017

Power of a Number in Visual Basic NET

Here is a sample program that will ask the user to give the base and exponent value and then our program will compute the power value of the given base and exponent number by our user using Microsoft Visual Basic NET as our programming language.

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 Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click

    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim base, exponent, compute As Integer

        base = Val(TextBox1.Text)
        exponent = Val(TextBox2.Text)

        compute = Math.Pow(base, exponent)
       
        Label5.Text = "The power value is  " & compute & "."
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        Label5.Text = ""
        TextBox1.Focus()
    End Sub
End Class



Square Root Solver in Visual Basic NET

Hi there in this article I would like to share with you a sample program that will ask the user to give a number in integer value and then our program will convert the square root equivalent of the given number by our user. The code is very easy to understand written in Visual Basic NET. I am using Visual Studio 2013 as my programming tool in this sample program. 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


Public Class Form1

    Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click

    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim a, sqr_convert As Integer

        a = Val(TextBox1.Text)
        sqr_convert = Math.Sqrt(a)
        Label3.Text = "The square root equivalent of " & a & " is " & sqr_convert & "."
    End Sub

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



Monday, April 3, 2017

Addition of Two Numbers in Visual Basic 6

A very simple program that I wrote in Visual Basic 6 to ask the user to give two numbers and then our program will compute for the total sum of the two numbers. 

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 sum, val_1, val_2 As Integer

val_1 = Val(Text1.Text)
val_2 = Val(Text2.Text)

sum = (val_1 + val_2)

Label3.Caption = "The sum of " & val_1 & " and " & val_2 & " is " & sum & "."
End Sub

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

End Sub

Private Sub Command3_Click()
End

End Sub


Thursday, March 30, 2017

Old Age Checker in C++

A very simple program that I wrote in C++ way back in 2010 in my C++ programming class in college to check if the user is old enough I am using array as my data structure and if conditional statement in C++.

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

My mobile number here in the Philippines is 09173084360.


Program Listing

#include <iostream>
#include <iomanip>


using namespace std;


struct item {

    string name[2];
    int age[2];
};

  main()
    {
      item child;
      cout << "\t\t Determine Old Age ";
      cout << "\n\n";

        for (int x=0; x<2; x++) {
            cin.ignore();
            cout << "\nEnter the Child's Name : ";
            getline(cin,child.name[x]);
            cout << "\nEnter the Child's Age  : ";
            cin >> child.age[x];
        }

             cout << "\n\n";
               if (child.age[0] > child.age[1]) {
                    cout << "\n\n";
                   cout << child.name[0] << " is much older compared to "
                    << child.name[1];

               }
               else {
                      cout << "\n\n";
                    cout << child.name[1] << " is much older compared to "
                    << child.name[0];
               }

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

Product Costing Calculator in C++

A very simple program that I wrote using C++ to solve the product cost this program is very useful in business day to day operations. I am using CodeBlocks as my text editor and Dev C++ as my C++ compiler in this sample program. Thank you.

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

My mobile number here in the Philippines is 09173084360.



Program Listing

#include <iostream>
#include <iomanip>


using namespace std;


struct item {

    string name,type;
    int quantity;
    float price;
};

main() {
     item product;
     float solve=0.00;
     cout << "\n\tProduct Description 1.0";
     cout << "\n\n";
     cout << "Enter Product Name         : ";
     getline(cin,product.name);
     cout << "Enter Product Description  : ";
     getline(cin,product.type);
     cout << "Enter Product Quantity     : ";
     cin >> product.quantity;
     cout << "Enter Product Price/Pcs    : ";
     cin >> product.price;

     solve = (product.quantity * product.price);

     cout << fixed << setprecision(2);

     cout << "\n  === Report ===";
     cout << "\n\n";
     cout << "\nProduct Name   : " << product.name;
     cout << "\nProduct Type   : " << product.type;
     cout << "\nQuantity       : " << product.quantity;
     cout << "\nPrice          : " << product.price;
     cout << "\n\n Total Cost  : $ " << solve;
     cout << "\n\n";
     system("pause");
}


Subtraction of Two Numbers in Turbo Pascal

A  very simple program that I wrote using Pascal to ask the user to give two numbers and then our program will find the difference between the two numbers based on the user given numbers. The code is very easy to understand and use. 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

{Date : March 30, 2017    Thursday            }
{Metro Manila, Philippines                  }
{jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program subtract_numbers;

Uses WinCrt;

var a,b,difference : integer;

Begin
clrscr;
a:=0;
b:=0;
difference := 0;
 writeln;
 Writeln;
 writeln('SUBTRACTION OF TWO NUMBERS IN PASCAL');
 writeln;
 write('Give first number : ');
 readln(a);
 write('Give second number : ');
 readln(b);

 difference := (a-b);
 writeln;
 write('The difference between ' ,a, ' and ' ,b,' is ' ,difference,'.');
 writeln;
 Writeln;
 writeln('END OF PROGRAM');
readln;
End.