Sunday, October 6, 2019

Array Operations in C Programming Language

In this article I would like to share with you a program to show you the different array operations 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.



Program Listing

#include <stdio.h>
#include <conio.h>

#define MAX 5

void insert ( int *, int pos, int num ) ;
void del ( int *, int pos ) ;
void reverse ( int * ) ;
void display ( int * ) ;
void search ( int *, int num ) ;

void main( )
{
int arr[5] ;

insert ( arr, 1, 11 ) ;
insert ( arr, 2, 12 ) ;
insert ( arr, 3, 13 ) ;
insert ( arr, 4, 14 ) ;
insert ( arr, 5, 15 ) ;

printf ( "\nElements of Array: " ) ;
display ( arr ) ;

del ( arr, 5 ) ;
del ( arr, 2 ) ;
printf ( "\n\nAfter deletion: " ) ;
display ( arr ) ;

insert ( arr, 2, 222 ) ;
insert ( arr, 5, 555 ) ;
printf ( "\n\nAfter insertion: " ) ;
display ( arr ) ;
reverse ( arr ) ;
printf ( "\n\nAfter reversing: " ) ;
display ( arr ) ;
search ( arr, 222 ) ;
search ( arr, 666 ) ;

getch( ) ;
}

/* inserts an element num at given position pos */
void insert ( int *arr, int pos, int num )
{
/* shift elements to right */
int i ;
for ( i = MAX - 1 ; i >= pos ; i-- )
arr[i] = arr[i - 1] ;
arr[i] = num ;
}

/* deletes an element from the given position pos */
void del ( int *arr, int pos )
{
/* skip to the desired position */
int i ;
for ( i = pos ; i < MAX ; i++ )
arr[i - 1] = arr[i] ;
arr[i - 1] = 0 ;
}

/* reverses the entire array */
void reverse ( int *arr )
{
int i ;
for ( i = 0 ; i < MAX / 2 ; i++ )
{
int temp = arr[i] ;
arr[i] = arr[MAX - 1 - i] ;
arr[MAX - 1 - i] = temp ;
}
}

/* searches array for a given element num */
void search ( int *arr, int num )
{
/* Traverse the array */
int i ;
for ( i = 0 ; i < MAX ; i++ )
{
if ( arr[i] == num )
{
printf ( "\n\nThe element %d is present at %dth position.", num, 
i + 1 ) ;
return ;
}
}

if ( i == MAX )
printf ( "\n\nThe element %d is not present in the array.", num ) ;
}

/* displays the contents of a array */
void display ( int *arr )
{
/* traverse the entire array */
int i ;
printf ( "\n" ) ;
for ( i = 0 ; i < MAX ; i++ )
printf ( "%d\t", arr[i] ) ;
}

Merging of Two One Dimensional Arrays in C


A simple program that I wrote before to merge two dimensional arrays using C Programming 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.



Program Listing

#include <stdio.h>
#include <conio.h>
#include <alloc.h>

#define MAX1 5
#define MAX2 7

int *arr ;

int* create ( int ) ;
void sort ( int *, int ) ;
void display ( int *, int ) ;
int* merge ( int *, int * ) ;
void main( )
{
int *a, *b, *c ;

clrscr( ) ;

printf (  "\nEnter elements for first array: \n\n" ) ;
a = create ( MAX1 ) ;

printf ( "\nEnter elements for second array: \n\n" ) ;
b = create ( MAX2 ) ;

sort ( a, MAX1 ) ;
sort ( b, MAX2 ) ;

printf ( "\nFirst array: \n" ) ;
display ( a, MAX1 ) ;
printf ( "\n\nSecond array: \n" ) ;
display ( b, MAX2 ) ;
printf ( "\n\nAfter Merging: \n" ) ;

c = merge ( a, b ) ;
display ( c, MAX1 + MAX2 ) ;

getch( ) ;
}

/* creates array of given size, dynamically */
int* create ( int size )
{
int *arr, i ;
arr = ( int * ) malloc ( sizeof ( int ) * size ) ;

for ( i = 0 ; i < size ; i++ )
{
printf ( "Enter the element no. %d: ", i + 1 ) ;
scanf ( "%d", &arr[i] ) ;
}
return arr ;
}

/* sorts array in ascending order */
void sort ( int *arr, int size )
{
int i, temp, j ;
for ( i = 0 ; i < size ; i++ )
{
for ( j = i + 1 ; j < size ; j++ )
{
if ( arr[i] > arr[j] )
{
temp = arr[i] ;
arr[i] = arr[j] ;
arr[j] = temp ;
}
}
}
}

/* displays the contents of array */
void display ( int *arr, int size )
{
int i ;
for ( i = 0 ; i < size ; i++)
printf (  "%d\t", arr[i] ) ;
}

/* merges two arrays of different size */
int* merge ( int *a, int *b )
{
int *arr ;
int i, k, j ;
int size = MAX1 + MAX2 ;
arr = ( int * ) malloc ( sizeof ( int ) * ( size ) ) ;

for ( k = 0, j = 0, i = 0 ; i <= size ; i++ )
{
if ( a[k] < b[j] )
{
arr[i] = a[k] ;
k++ ;
if ( k >= MAX1 )
{
for ( i++ ; j < MAX2 ; j++, i++ )
arr[i] = b[j] ;
}
}
else
{
arr[i] = b[j] ;
j++ ;
if ( j >= MAX2 )
{
for ( i++ ; k < MAX1 ; k++, i++ )
arr[i] = a[k] ;
}
}
}

return arr ;
}

POS with Inventory Management System Using Microsoft Visual Basic 6 and Microsoft Access

Here is a sample program that is being provided by my close friend, business partner and fellow software engineer Sir Larry Dave Emol.

This Automated POS with Inventory Management System is developed using Visual Basic 6 and using MS Access 2003 database back end. This is developed for the school project requirements. I used Barcode scanner to login and read the barcode information encoded in the system. It monitors the Daily, Mothly and Yearly Sales Income. Out of stocks print receipt, Add product, and Print Reports. 


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







Move all Record and Display in a Table in Microsoft Visual Basic 6 and Microsoft Access

Here is a sample program that is being provided by my close friend, business partner and fellow software engineer Sir Larry Dave Emol. He created this program to Move all Record and Display in a Table 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

FORM CODES

Private Sub Command3_Click()
On Error Resume Next
Call drop
Call dbConn
conn.Execute "DELETE FROM tblInfo"
MsgBox "All information has been successfully moved!", vbInformation
Call SQLDB(Me.Adodc1, "Select * from tblInfo order by LASTNAME")
End Sub



Private Sub Form_Activate()
On Error Resume Next
Call SQLDB(Me.Adodc1, "Select * from tblInfo order by LASTNAME Desc")
Set Me.DataGrid1.DataSource = Me.Adodc1
Call SQLDB(Me.Adodc2, "Select * from tblInfoTech order by FULLNAME Desc")
Set Me.DataGrid2.DataSource = Me.Adodc2
End Sub

Public Sub drop()
    Call SQLDB(Me.Adodc1, "Select * From tblInfo")
    Call SQLDB(Me.Adodc2, "Select * From tblInfoTech")
   
    If Me.Adodc1.Recordset.RecordCount = 0 Then
    ElseIf Me.Adodc1.Recordset.RecordCount = 1 Then
        Me.Caption = Me.Adodc1.Recordset.Fields("LASTNAME").Value & ", " & Me.Adodc1.Recordset.Fields("FIRSTNAME").Value & " " & Me.Adodc1.Recordset.Fields("MIDDLENAME").Value
        With Me.Adodc2.Recordset
            .AddNew
            .Fields(1) = Me.Caption
            .Fields(2) = Me.Adodc1.Recordset.Fields(4)
            .Update
        End With
    Else
     
        Me.Adodc1.Recordset.MoveNext
        Me.Adodc1.Recordset.MoveFirst
        Me.Caption = Me.Adodc1.Recordset.Fields("LASTNAME").Value & ", " & Me.Adodc1.Recordset.Fields("FIRSTNAME").Value & " " & Me.Adodc1.Recordset.Fields("MIDDLENAME").Value
            Do Until Me.Adodc1.Recordset.BOF
           
                If Me.Adodc1.Recordset.EOF = True Then
                    Me.Adodc1.Recordset.MoveFirst
   
                    Exit Do
                   
                Else
   
                    With Me.Adodc2.Recordset
                        .AddNew
                        .Fields(1) = Me.Caption
                        .Fields(2) = Me.Adodc1.Recordset.Fields(4)
                        .Update
                       
                        Me.Adodc1.Recordset.MoveNext
                         Me.Caption = ""
                         Me.Caption = Me.Adodc1.Recordset.Fields("LASTNAME").Value & ", " & Me.Adodc1.Recordset.Fields("FIRSTNAME").Value & " " & Me.Adodc1.Recordset.Fields("MIDDLENAME").Value
                     
                    End With
                       
                End If
               
            Loop
    End If
Me.Adodc1.Refresh
Me.Adodc2.Refresh

End Sub


MODULE CODES(DB Connection)

Option Explicit

'variables for ADODB
Public conn As New ADODB.Connection
Public ctr As Integer



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

Public Sub dbConn()
  Set conn = New ADODB.Connection
  conn.ConnectionString = strConn2
  conn.Open
End Sub

Public Function strConn2() As String
  strConn2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & AppDir & "Tutorial.mdb;Persist Security Info=False;Jet OLEDB:Database Password = "
End Function

Public Sub SQLDB(adoObj As Adodc, AdoRec As String) 'for SQL Recordsource

    'Loads the database and provides the database password
    adoObj.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & AppDir & "Tutorial.mdb;Persist Security Info=False;Jet OLEDB:Database Password = "
   
    'Sets the command type to Table
    adoObj.CommandType = adCmdText
   
    'Loads the source table of info
    adoObj.RecordSource = AdoRec

    'refreshes database status
     adoObj.Refresh
End Sub



Show and Hide Password in JQuery Framework

Here is a sample program that is being provided by my close friend, business partner and fellow software engineer Sir Larry Dave Emol. He created this program to show and Hide Password in JQuery

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

//showpassword js
$(".showpas").on('click', function () {
$(this).parent().find('input').toggleAttr('type', 'text', 'password');
$(this).toggleClass('show');

if ($(this).hasClass('show')) {
$(this).text('hide');
} else {
$(this).text('Show');
}
});

// jquery toggle just the attribute value
$.fn.toggleAttr = function (attr, val1, val2) {
var test = $(this).attr(attr);
if (test === val1) {
$(this).attr(attr, val2);
return this;
}
if (test === val2) {
$(this).attr(attr, val1);
return this;
}
// default to val1 if neither
$(this).attr(attr, val1);




return this;
};


Select and Save Color Header as Image in Microsoft Visual Basic 6

Here is a sample program that is being provided by my close friend, business partner and fellow software engineer Sir Larry Dave Emol. He created this program to Select and Save Color Header as Image in Vb6

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 colorpicker_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
colorpick.Picture = Nothing
colorpick.BackColor = colorpicker.Point(x, y)
End Sub

Private Sub Command1_Click()
namefile = App.Path & ("/" & Me.Caption) & ".jpg"
SavePicture colorpick.Image, namefile
End Sub

Private Sub Form_Load()
colorpick.Picture = LoadPicture(App.Path & "\Header.jpg")
End Sub




Perimeter of the Rectangle Solver in C++

In this article I would like to share with you a simple program that I wrote using C++ as my programming language that will ask the user to give length and width of the rectangle and then the program will compute the perimeter of the rectangle. The code is very simple and easy to understand by the beginners in C++ programming.

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

perimeter.cpp

// perimeter.cpp
// Author : Jake Rodriguez Pomperada
// Date   : October 5, 2019   5:49 AM Saturday
// Email  : jakerpomperada@gmail.com
// Webiste : http://www.jakerpomperada.com
// Location : Bacolod City, Negros Occidental Philippines

#include <iostream>

using namespace std;

int main() {
int length=0,width=0, perimeter=0;
cout <<"\n\n";
cout <<"\tPerimeter of the Rectangle Solver";
cout <<"\n\n";
cout <<"\tGive length of the rectangle :";
cin >> length;
cout <<"\tGive width of the rectangle :";
cin >> width;
perimeter = 2 * (length * width);
cout <<"\n\n";
cout << "\tPerimeter of the rectangle is "
    << perimeter <<".";
    
cout <<"\n\n";
cout <<"\tEnd of Program";    
}




Perimeter of the Rectangle Solver in C++