Friday, September 6, 2019

Quick Sort in C++

Here is a sample program that I wrote using C++ to demonstrate the quick sort algorithm. It will ask the user to give how many items to be processed and then the program will sort and display the unsorted items and sorted items in the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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 Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com




Sample Program Output

Program Listing

#include<iostream>
#include<cstdlib>

using namespace std;


void swap_numbers(int *a, int *b)
{
int temp; 
temp = *a;
*a = *b;
*b = temp;
}


int Partition(int a[], int low, int high)
{
int pivot, index, i;
index = low;
pivot = high;


for(i=low; i < high; i++)
{
if(a[i] < a[pivot])
{
swap_numbers(&a[i], &a[index]);
index++;
}
}

swap_numbers(&a[pivot], &a[index]);

return index;
}


int RandomPivotPartition(int a[], int low, int high)
{
int pvt, n, temp;
n = rand();

pvt = low + n%(high-low+1);


swap_numbers(&a[high], &a[pvt]);

return Partition(a, low, high);
}


int QuickSort(int a[], int low, int high)
{
int pindex;
if(low < high)
{

pindex = RandomPivotPartition(a, low, high);

QuickSort(a, low, pindex-1);
QuickSort(a, pindex+1, high);
}
return 0;
}

int main()
{
int n=0, i=0;
cout <<"\n";
cout <<"Quick Sort in C++";
cout <<"\n";
cout<<"\nHow many items to be sorted?  ";
cin>>n;

int arr[n];
for(i = 0; i < n; i++)
{
cout<<"Enter item no. "<<i+1<<": ";
cin>>arr[i];
}
    cout <<"\n";
  cout<<"\nUnSorted Data ";
for (i = 0; i < n; i++)
        cout<<" ,"<<arr[i];
    cout <<"\n";
QuickSort(arr, 0, n-1);


cout<<"\nSorted Data ";
for (i = 0; i < n; i++)
        cout<<" ,"<<arr[i];
    cout <<"\n\n";
cout <<"\tEnd of Program";   
cout <<"\n";
return 0;
}




Wednesday, September 4, 2019

Employee's Profile Using Union in C Language


In today's I would like to share with you guys a simple program that I wrote how to use union in C programming language I called this program Employee's Profile Using Union in C Language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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 Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output


Program Listing

/* emp_profile.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 29, 2018  Thursday  2:33 PM
   Location : Bacolod City, Negros Occidental
   Tool     : Dev C++ Version 5.11
   Website  : http://www.jakerpomperada.com
   Email    : jakerpomperada@jakerpomperada.com and jakerpomperada@gmail.com
*/
#include<stdio.h>
union emp
{
char emp_name[100];
char emp_position[100];
int age;
    float salary;
}; 
void main()
{
 union emp profile;
 printf("\n\n");
 printf("\tEmployee's Profile Using Union");
 printf("\n\n");
 printf("\tEmployees Name     : ");
 gets(profile.emp_name);
 printf("\n");
 printf("\tName         :  %s\n",profile.emp_name);
 printf("\n");
 printf("\tEmployees Position : ");
 gets(profile.emp_position);
 printf("\n");
 printf("\tYour position is %s.\n",profile.emp_position);
 printf("\n");
 printf("\tEmployees Age : ");
 scanf("%d",&profile.age);
 printf("\n");
 printf("\tYour age is %d year(s) old.\n",profile.age);
 printf("\n");
 printf("\tEmployees Salary : PHP ");
 scanf("%f",&profile.salary);
 printf("\n");
 printf("\tYour salary is PHP %.2f",profile.salary);
 printf("\n\n");
 printf("\tEnd of Program");
 printf("\n\n");
}




Sunday, September 1, 2019

CRUD ADODB Connection in Visual Basic 6 and Microsoft Access

I this article I would like to share with you sample program written by my close friend, business partner and fellow software engineer Sir Larry Dave Emol a simple CRUD ADODB Connection in Visual Basic 6 and Microsoft Access.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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 Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com





Sample Program Output


Program Listing


FORM CODES

Private Sub Command1_Click()
Form1.Show 1
End Sub

Private Sub Command2_Click()
If Me.Tag = "" Then
 MsgBox "Please select data to update", vbCritical, "Crud"
Else
Form1.Text2.Text = Me.Listview1.selectedItem.ListSubItems(3)
Form1.Text3.Text = Listview1.selectedItem.ListSubItems(4)
Form1.Text4.Text = Listview1.selectedItem.ListSubItems(5)
Form1.Command1.Caption = "UPDATE"
Form1.Caption = "UPDATE"
Form1.Show 1, Mainform
End If
End Sub

Private Sub Command3_Click()
'On Error Resume Next
If Me.Tag = "" Then
 MsgBox "Please select data to delete", vbCritical, "Crud"
Else
Set rstUserAcct = New ADODB.Recordset
    If rstUserAcct.State = 1 Then rstUserAcct.Close
    rstUserAcct.Open "Select * from tblInfo where ID like'" & Me.Tag & "'", MyConn, adOpenDynamic, adLockBatchOptimistic
    rstUserAcct.Delete
    rstUserAcct.UpdateBatch
    data
    MsgBox "Successfully Deleted", vbInformation, "DELETE"
    Me.Tag = ""
End If
End Sub

Private Sub Form_Activate()
data
End Sub

Sub data()
On Error Resume Next
Dim lst
Dim cnt As Integer
Dim X As Integer
Set rstUserAcct = New ADODB.Recordset
    If rstUserAcct.State = 1 Then rstUserAcct.Close
    rstUserAcct.Open "Select * from tblInfo", MyConn, adOpenDynamic, adLockBatchOptimistic
    
With Me.Listview1
    .ColumnHeaders.Clear
    .ListItems.Clear
    .ColumnHeaders.Add , , "", 0
    .ColumnHeaders.Add , , "USERNAME", 3000
    .ColumnHeaders.Add , , "PASSWORD", 4000
    .ColumnHeaders.Add , , "FISTNAME", 4000
    .ColumnHeaders.Add , , "MIDDLENAME", 4000
    .ColumnHeaders.Add , , "LASTNAME", 4000
End With
Do Until rstUserAcct.EOF
    Set lst = Listview1.ListItems.Add(, , rstUserAcct.Fields!ID)
            
            lst.ListSubItems.Add , , rstUserAcct.Fields!UserName
            lst.ListSubItems.Add , , rstUserAcct.Fields!Password
            lst.ListSubItems.Add , , rstUserAcct.Fields!firstname
            lst.ListSubItems.Add , , rstUserAcct.Fields!middlename
            lst.ListSubItems.Add , , rstUserAcct.Fields!lastname
  cnt = cnt + 1
rstUserAcct.MoveNext
Loop
Label1.Caption = "Total No. of record(s): " & cnt
End Sub


Private Sub Form_Unload(Cancel As Integer)
End
End Sub


Private Sub Listview1_Click()
Me.Tag = Me.Listview1.selectedItem.Text
End Sub

MODULE CODES

Option Explicit

Public MyConn As ADODB.Connection
Public rstUserAcct As ADODB.Recordset



Sub Main()
On Error Resume Next
        Set MyConn = New ADODB.Connection
        Set rstUserAcct = New ADODB.Recordset
        MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & AppDir & "Tutorial.mdb;Persist Security Info=False;Jet OLEDB:Database Password =IT098"
        MyConn.CursorLocation = adUseClient
        'Start up object
        Mainform.Show
End Sub

Public Function AppDir() As String
    If Right$(App.Path, 1) = "\" Then
        AppDir = App.Path
    Else
        AppDir = App.Path & "\"
    End If
End Function



Listview in Visual Basic 6 and Microsoft Access

I this article I would like to share with you sample program written by my close friend, business partner and fellow software engineer Sir Larry Dave Emol a simple listview implementation in Microsoft Visual Basic 6 and Microsoft Access.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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 Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com





Sample Program Output

Program Listing

MODULE  DB CONNECTION


Option Explicit

Public MyConn As ADODB.Connection
Public rstUserAcct As ADODB.Recordset



Sub Main()
On Error Resume Next
        Set MyConn = New ADODB.Connection
        Set rstUserAcct = New ADODB.Recordset
        MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & AppDir & "Tutorial.mdb;Persist Security Info=False;Jet OLEDB:Database Password =IT098"
        MyConn.CursorLocation = adUseClient
        'Start up object
        Mainform.Show
End Sub

Public Function AppDir() As String
    If Right$(App.Path, 1) = "\" Then
        AppDir = App.Path
    Else
        AppDir = App.Path & "\"
    End If
End Function


Private Sub Form_Activate()
data
End Sub

Sub data()
On Error Resume Next
Dim lst
Dim cnt As Integer
Dim X As Integer
Set rstUserAcct = New ADODB.Recordset
    If rstUserAcct.State = 1 Then rstUserAcct.Close
    rstUserAcct.Open "Select * from tblInfo", MyConn, adOpenDynamic, adLockBatchOptimistic
  
With Me.Listview1
    .ColumnHeaders.Clear
    .ListItems.Clear
    .ColumnHeaders.Add , , "", 0
    .ColumnHeaders.Add , , "USERNAME", 3000
    .ColumnHeaders.Add , , "PASSWORD", 4000
    .ColumnHeaders.Add , , "FISTNAME", 4000
    .ColumnHeaders.Add , , "MIDDLENAME", 4000
    .ColumnHeaders.Add , , "LASTNAME", 4000
End With
Do Until rstUserAcct.EOF
    Set lst = Listview1.ListItems.Add(, , rstUserAcct.Fields!ID)
          
            lst.ListSubItems.Add , , rstUserAcct.Fields!UserName
            lst.ListSubItems.Add , , rstUserAcct.Fields!Password
            lst.ListSubItems.Add , , rstUserAcct.Fields!firstname
            lst.ListSubItems.Add , , rstUserAcct.Fields!middlename
            lst.ListSubItems.Add , , rstUserAcct.Fields!lastname
  cnt = cnt + 1
rstUserAcct.MoveNext
Loop
Label1.Caption = "Total No. of record(s): " & cnt
End Sub


Private Sub Form_Unload(Cancel As Integer)
End
End Sub







Thursday, August 29, 2019

Area and Circumference of Circle Using Structures in Golang

Write a program to solve the area and circumference of the circle using functions and structures in Golang.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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 Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

/* area_circle.go
   Author : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date   : August 7, 2019   Wednesday  5:04 AM
   Emails : jakerpomperada@gmail.com and jakerpomperada@yahoo.com
*/

package main

import "fmt"

const PI float64 = 3.14

func solve_area(radius float64 ) float64 {
return PI * radius * radius
}

func solve_ci(radius float64 ) float64 {
return 2 * PI * radius
}

type check_circle struct {
rad float64

}


func main(){
var num check_circle
fmt.Print("\n")
fmt.Print("\tArea and Circumference of Circle Using Structures")
fmt.Print("\n\n")
fmt.Print("\tEnter radius of Circle : ")
fmt.Scanln(&num.rad)
area := solve_area(num.rad)
fmt.Print("\n")
fmt.Print("\tArea of Circle is : ")
fmt.Printf("%0.2f ",area)
ci := solve_ci(num.rad)
fmt.Print("\n\n")
fmt.Print("\tCircumference of Circle is : ")
fmt.Printf("%0.2f ",ci)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}


Three Attempts Login System in Visual Basic 6 and Microsoft Access

Here is a copy that is written by my business partner, a close friend and fellow software engineer Sir Larry Emol to ask the user to login the system after three attempts it will lock the user account. This program is written using Visual Basic 6 and Microsoft Access as our database.


I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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 Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com





Sample Program Output


Program Listing


Private Sub Command1_Click()
On Error Resume Next
Static count As Integer
 Set rstUserAcct = New ADODB.Recordset
    If rstUserAcct.State = 1 Then rstUserAcct.Close
    rstUserAcct.Open "Select * from tblInfo where Username = '" & Text1.Text & "'", MyConn, adOpenDynamic, adLockBatchOptimistic
    
    
    If Me.Text1.Text = "" Then
    MsgBox "Enter Username", vbInformation, "Username"
    Me.Text1.SetFocus
    Exit Sub
    End If
    
    If Me.Text2.Text = "" Then
    MsgBox "Enter Password", vbInformation, "Password"
    Me.Text2.SetFocus
    Exit Sub
    End If
    
    If rstUserAcct.RecordCount = 0 Then
    MsgBox "Username not found", vbInformation, "Username"
    Exit Sub
    End If
           
    If rstUserAcct.Fields!Locked = True Then
    MsgBox "Password is Lock", vbInformation, "Contact Administrator"
    Exit Sub
    End If
            
If rstUserAcct.Fields("Password") = Text2.Text Then
            
                Unload Me
                Mainform.Show
                
Else
MsgBox "Invalid Password!", vbExclamation, "Sample App"
count = count + 1
Me.Tag = count
            If Me.Tag = 1 Then
                Me.Label2.Caption = "2 Attempts"
            ElseIf Me.Tag = 2 Then
                Me.Label2.Caption = "1 Attempts"
            ElseIf Me.Tag = 3 Then
                rstUserAcct.Fields!Locked = True
                rstUserAcct.UpdateBatch
            End If
End If
End Sub




Arithmetic Operators Using Structures in Golang


Write a program that will ask the user to give two numbers and then the program will perform addition, subtraction, multiplication, division, and modulus using structures.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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 Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output


Program Listing

/* arithmetic.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 7, 2019   Wednesday  5:10 AM
   Location : Bacolod City, Negros Occidental
   Emails : jakerpomperada@gmail.com and jakerpomperada@yahoo.com
*/

package main

import "fmt"

type check_math struct {
a int32
    b int32
}

func main(){
var val check_math
var  sum,difference,product,quotient,modulus int32

fmt.Print("\n")
fmt.Print("\tArithmetic Operators Using Structures")
fmt.Print("\n\n")
fmt.Print("\tGive the First  Value   : ")
fmt.Scanln(&val.a)
fmt.Print("\tGive the Second Value   : ")
fmt.Scanln(&val.b)

// Perform arithmetic operations here
sum         = (val.a + val.b);
difference  = (val.a - val.b);
product     = (val.a * val.b);
quotient    = (val.a / val.b);
modulus     = (val.a % val.b);

fmt.Print("\n")
fmt.Print("\t===== DISPLAY RESULTS =====")
fmt.Print("\n\n")
fmt.Print("\tThe sum of ",val.a," and ",val.b, " is ",sum,"\n")
fmt.Print("\tThe difference between ",val.a," and ",val.b, " is ",difference,"\n")
fmt.Print("\tThe product of ",val.a," and ",val.b, " is ",product,"\n")
fmt.Print("\tThe quotient between ",val.a," and ",val.b, " is ",quotient,"\n")
fmt.Print("\tThe modulus value of ",val.a," and ",val.b, " is ",modulus,"\n")
fmt.Print("\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}
 

Advanced Operating System and Networking By Jake Pomperada, Mark Allen M...