Sunday, February 5, 2017

Age Checker Using Classes in C++

Here is a sample program that will ask the user to give his or her age and then our program will check and determine if the user is an already an adult or still a minor using classes in C++.

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 Listing


#include <iostream>

using namespace std;

class age {
    int ages;
    public:
     int getdata();
     void display(void);
};


int age:: getdata()
{
    cout << "Enter the age of the person : ";
    cin >> ages;
    if (ages >= 18) {
        cout <<"\n The person is Already an Adult.";
    }
    else
     {
        cout <<"\n The person is Still a Minor.";
    }
 cout << "\n\n";
 system("pause");
}

void age:: display(void)
{
    int value;
    value = getdata();
}


main()
{
    age start;
    start.display();
}



Payroll System in C++ Using Classes

Here is a sample payroll program that I wrote for my programming class before a long time ago that uses object oriented programming approach it uses class to declare, use and process variables in our program. I hope my work is useful to your learning in C++ 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.



Program Listing

#include <iostream>
#include <iomanip>

using namespace std;


class payroll {

    private:

    string name;
    int days_work;
    float rate;
    float solve;

    public :

      int get_info();
      void display_info();
};

 int payroll :: get_info()
 {
     cout << "\t\t Simple Payroll System Using OOP in C++";
     cout << "\n\n";
     cout << "Enter Employees Name     : ";
     getline(cin,name);
     cout << "Enter No. of Days Worked : ";
     cin >> days_work;
     cout << "Enter Daily Rate         : ";
     cin >> rate;
     cout << fixed << setprecision(2);
     solve = (days_work * rate);
 }

 void payroll ::display_info()
    {

     cout << "\n\n";
     cout << "==== DETAILED REPORT =====";
     cout << "\n\n";
     cout << "\nEmployees Name     : " << name;
     cout << "\nEmployees Salay is : $" << solve;
     cout << "\n\n";
     system("pause");
    }


    main() {
        payroll emp;
        emp.get_info();
        emp.display_info();

    }



Swapping of Two Numbers in C++

Here is a sample program that I wrote a long time ago while I'm working as a college professor teaching C++ programming subjects. This type of program will ask the user to give two numbers and then it will swap or interchange the arrangement of the two numbers given by our user. I am using CodeBlocks as my C++ editor and Dev C++ as my C++ compiler all of them are free to download over the Internet. 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.


Program Listing

#include <iostream>

using namespace std;

 int temp=0;


class swapping {

    public :
 int values[1];

    int swap_number(int a, int b)
    {
      temp = values[0];
     values[0] =values[1];
     values[1] = temp;
    }
};

 main() {
     swapping numbers;

      cout << "\t\t Swapping of Values 1.0";
    cout << "\n\n";
    cout << "Enter first number : ";
    cin >> numbers.values[0];
    cout << "Enter second number : ";
     cin >> numbers.values[1];
     cout << "Before the Swapping of values ";
     cout << "\n\n";
    cout << numbers.values[0] << " " << numbers.values[1];

     numbers.swap_number(numbers.values[0],numbers.values[1]);

     cout << "\n\n";
     cout << "After the Swapping of values ";
     cout << "\n\n";
     cout << numbers.values[0] << " " << numbers.values[1];
     cout << "\n\n\n";
     system("PAUSE");
}




Saving two values in text file in C++

Here is a simple program that I wrote that will save the two values in a text file using C++ as our programming language. The code is very short 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.


Program Listing

#include <iostream>
#include <fstream>

 using namespace std;

  class test {
      public:

       int x,y;
  };

  main() {
      test values;
      int solve=0;
   ofstream myfile("result.txt");
  cout << "Enter two numbers : ";
  cin >> values.x >> values.y;
  cout << "\n\n";
  solve = (values.x) + (values.y);
  cout << "The sum is " << solve;
  cout << "\n\n";
  myfile << "\t Result";
  myfile << "\n\n";
  myfile << "The sum is " << solve << ".";
  myfile.close();
  }

Sum of Digits in Visual Basic Net

In this article I would like to share with you a sample program that will ask the user to give a series of numbers and then our program will compute the total sum of digits based on the given number by our user using Visual Basic NET. The code is very short 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

Public Class Form1

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

        Dim n, sum, r As Integer

        n = Val(TextBox1.Text)

        sum = 0
        While n <> 0
            r = n Mod 10
            sum += r
            n \= 10
        End While
        Label2.Text = " The Sum of Digits is " + sum.ToString() + "."
   End Sub

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





Leap Year Checker in Visual Basic NET

Here is a simple program that I wrote in Visual Basic NET that will ask the user to give a year and then our program will check if the given year is a leap year or not a leap year. The code is very short 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

Public Class Form1

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

        Dim y As Integer

        y = Val(TextBox1.Text)

        If y Mod 100 = 0 Then
            If y Mod 400 = 0 Then
                Label2.Text = " The year " + y.ToString + " is a Leap Year."
            Else
                Label2.Text = " The year " + y.ToString + " is NOT a Leap Year."
            End If
        Else
            If y Mod 4 = 0 Then
                Label2.Text = " The year " + y.ToString + " is a Leap Year."
            Else
                Label2.Text = " The year " + y.ToString + " is NOT a Leap Year."
            End If
        End If

        
    End Sub

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



Palindrome Number in Visual Basic NET

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 written in Visual Basic NET will give if the given number is a Palindrome or Not a Palindrome. 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


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim num As String
        Dim sum, t, r As Integer


        num = TextBox1.Text

        sum = 0
        t = num
        While num <> 0
            r = num Mod 10
            sum = sum * 10 + r
            num = num \ 10
        End While
        If sum = t Then
            Label2.Text = " The Number " + t.ToString() + " is a Palindrome Number."
        Else
            Label2.Text = " The Number " + t.ToString() + " is NOT a Palindrome Number."
        End If
    End Sub

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



ID Fields Listing in PHP and MySQL

I have encounter a problem regarding how to display a series of numbers in the number or id field in PHP and MySQL when we want to display a series of records in our field. Actually the solution is a very simple looping statement to increment in ascending order every time we at records in our tables here is the solution below. 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

<html>
<body>
<style type="text/css">
th,td{
border-width:0px 1px 1px 0px;
}
</style>
<?php
$counter=1;
mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('profile')  or die(mysql_error());
$query=mysql_query("select * from user_table ")  or die(mysql_error());
echo'<table border="1" ><th >ID</th><th>Name</th><th>Work</th>';
while($res=mysql_fetch_array($query))
{
  echo'<tr><td>'.$counter.'</td><td>'.$res['name'].'</td><td>'.$res['work'].'</td></tr>';
  $counter++;
}
echo'</table>';
?>
</body>
</html>





Student Enrollment System in PHP and MySQL

In this article I would like to share with you a program that I wrote using PHP and MySQL as my programming language. This program will allow the student to be enrolled in a university or college there are still many things to be improved in this program in my opinion I just want to share with you this one to give anybody some ideas how to create an enrollment system using PHP and MySQL. 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




Student Alumni Registration System in PHP and MySQL

Here is a simple program that I wrote in PHP what enables the user to register student as an alumni in the school that he or she graduated. I'm using bootstrap for the layout design for the code is demonstrate how to transfer one record of the student from one table to another table using PHP and MySQL. I hope my work will will help you a lot in your learning in PHP and MySQL application development.  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




Sunday, January 29, 2017

Maximum of Three Numbers in Visual Basic NET

Here is a sample program that I wrote using Microsoft Visual Basic NET that will ask the user to give three numbers and then it will check which of the three numbers is the maximum in terms of numerical value.  The code is very short and easy to understand. 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

    Function Maximum(ByVal valueOne As Double, _
       ByVal valueTwo As Double, ByVal valueThree As Double) _
       As Double
        Return Math.Max(Math.Max(valueOne, valueTwo), valueThree)
    End Function
  
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        End
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim val1, val2, val3 As Integer

        val1 = Val(TextBox1.Text)
        val2 = Val(TextBox2.Text)
        val3 = Val(TextBox3.Text)

        Label4.Text = "The biggest number is " & Maximum(val1, val2, val3) & "."
    End Sub
End Class






Square and Cube Value Solver in Visual Basic NET

Hi there in this article I would like to share with you a sample program that I wrote in Visual Basic NET to ask the user to give a number and then our program will compute the square and cube value of the given number. The code is very short 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

Public Class Form1
    Function Square(ByVal y As Integer) As Integer
        Return y ^ 2
    End Function

    Function Cube(ByVal y As Integer) As Integer
        Return y ^ 3
    End Function


    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Label2.Text = "The square value of " & TextBox1.Text & " is " & Square(Val(TextBox1.Text)) & "."
        Label3.Text = "The cube vallue of " & TextBox1.Text & " is " & Cube(Val(TextBox1.Text)) & "."
    End Sub

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

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