Thursday, December 5, 2019

Classes in C++

I wrote this program to show you how to create a class using the 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.


https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.



Sample Program Output


Program Listing

#include <iostream>
#include <stdlib.h>

using namespace std;

class demo {

public void:

  void message() {
     cout <<"\tYou created a Class in C++";
     cout <<"\n";
     system("pause");
}

};



int main()
{
  demo  display;
  display.message();

Wednesday, December 4, 2019

Sum and Average of Two Numbers in C

A simple program that I wrote that will ask the user to give two numbers and then the program will compute the sum and average of the two numbers and display the results in the screen 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.


https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.



Sample Program Output


Program Listing

sum_average.c

#include <stdio.h>

int main()
{
    int a=0,b=0,sum=0;
    float average=0;
    printf("\n\n");
    printf("\tSum and Average of Two Numbers in C");
    printf("\n\n");
    printf("\tGive First  Number : ");
    scanf("%d",&a);
    printf("\tGove Second Number : ");
    scanf("%d",&b);
    sum=a+b;
    average= (float)(a+b)/2;
  printf("\n");
    printf("\tThe Sum of %d and %d is = %d.",a,b,sum);
    printf("\n");
    printf("\tThe Average of %d and %d is = %0.2f.",a,b,average);
    printf("\n\n");
    printf("\tEnd of Program");
    printf("\n");

    return 0;
}



Tuesday, December 3, 2019

Swapping of Two Numbers Using Bitwise Operator in C

I wrote this program to ask the user to give two numbers and then the program will swap the arrangement of two numbers using a bitwise operator of 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.


https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.




Sample Program Output


Program Listing

swap.c

#include <stdio.h>

int main()
{
      int a=0,b=0;
      printf("\n\n");
      printf("\tSwapping of Two Numbers Using Bitwise Operator in C");
      printf("\n\n");
      printf("\tEnter First Number  : ");
      scanf("%d", &a);
      printf("\tEnter Second Number : ");
      scanf("%d",&b);
      printf("\n\n");
      printf("\tNumbers Before Swapping");
      printf("\n\n");
      printf("\ta = %d and b = %d\n", a, b);

     a = a ^ b;
     b = a ^ b;
     a = a ^ b;
     
printf("\n\n");
     printf("\tNumbers After Swapping");
     printf("\n\n");
     printf("\ta = %d and b = %d", a, b);
     printf("\n\n");
     printf("\tEnd of Program");
     printf("\n");
}


Division of Two Numbers in C

I wrote this program to ask the user to give two numbers and then the program will divide the value of two numbers 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.


https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.




Sample Program Output


Program Listing

division.c

#include<stdio.h>

int main()
{
      int num1=0,num2=0,result=0;
      printf("\n\n");
      printf("\tDivision of Two Numbers in C");
      printf("\n\n");
      printf("\tEnter First Number  : ");
      scanf("%d", &num1);
      printf("\tEnter Second Number : ");
      scanf("%d",&num2);
      result=num1/num2;
      printf("\n");
      printf("\tDivision of %d & %d is = %d.",num1,num2,result);
      printf("\n\n");
      printf("\tEnd of Program");
      printf("\n");
}

Arrow Keys Movement in Turbo C

A   Arrow Keys Movement in Turbo C in the C Programming Language program was written by my close friend and fellow software engineer Sir Ernel Fadriquilan. Thank you for sharing your code Sir Ernel.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.


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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.




Thank you very much for your help and support.


Program Listing

#include <stdio.h>
#include <string.h>
#include <alloc.h>
#include <graphics.h>
#include <stdlib.h>
#include <conio.h>
#include <bios.h>
#include <math.h>
#include <dos.h>

#define LTARROW 0x4B 
#define RTARROW 0x4D 
#define UPARROW 0x48 
#define DNARROW 0x50 
#define CR 0x0d 
#define ESC 0x1b 
#define ALT_X 0x2d 

long size = 0;
void far *buffer2 = 0;
void far *buffer1 = 0;

void draw_pixelbackground()
{
int i, xpos, ypos, color;
int xmax = getmaxx();
int ymax = getmaxy();

setbkcolor(BLUE);
setcolor(WHITE);
rectangle(0,0,xmax, ymax);

for(i = 0; i < 5000; i++)
{
xpos = rand() % xmax;
ypos = rand() % ymax;
color = rand() % 12;
putpixel(xpos, ypos, color);
}
}

void draw_object(int left, int top, int right, int bottom)
{
size = imagesize(left, top, right, bottom);
buffer1 = farmalloc(size);
buffer2 = farmalloc(size);
getimage(left, top, right, bottom, buffer1);

rectangle(left, top, right, bottom);
line(left, top, right, bottom);
line(left, bottom, right, top);
}

void move_object(int left, int top, int right, int bottom,int destx, int desty)
{
int width = right - left;
int height = bottom - top;
getimage(left, top, right, bottom, buffer2);
putimage(left, top, buffer1, COPY_PUT);

getimage(destx, desty, destx + width, desty + height, buffer1);
putimage(destx, desty, buffer2, COPY_PUT);
}


void main()
{
int grd, grm;
int key;
int x1 = 10, y1 = 30, x2 = 100, y2 = 70;
int newx, newy;
int xoffset = 10, yoffset = 5;
detectgraph(&grd,&grm);
initgraph(&grd, &grm, "");

draw_pixelbackground();

draw_object(x1, y1, x2, y2);

while(1)
{
key = bioskey(0);
if( (key & 0x00FF) > 0)
key = key & 0x00FF;
else
key = (key & 0xFF00) >> 8;

switch(key)
{
case LTARROW:
newx = x1 - xoffset;
newy = y1;
move_object(x1, y1, x2, y2, newx, newy);
x1 -= xoffset;
x2 -= xoffset;
break;

case RTARROW:
newx = x1 + xoffset;
newy = y1;
move_object(x1, y1, x2, y2, newx, newy);
x1 += xoffset;
x2 += xoffset;
break;

case DNARROW:
newx = x1;
newy = y1 + yoffset;
move_object(x1, y1, x2, y2, newx, newy);
y1 += yoffset;
y2 += yoffset;
break;

case UPARROW:
newx = x1;
newy = y1 - yoffset;
move_object(x1, y1, x2, y2, newx, newy);
y1 -= yoffset;
y2 -= yoffset;
break;

case ALT_X:
case ESC:
case CR:
closegraph();
exit(0);
}
}

}

Multiplication Table in Turbo C

A   Multiplication Table in Turbo C in the C Programming Language program was written by my close friend and fellow software engineer Sir Ernel Fadriquilan. Thank you for sharing your code Sir Ernel.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.


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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.




Thank you very much for your help and support.


Program Listing

//MULTIPLICATION TABLE
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>

void t()
{
int e,s;
for(s=0;s<=10;s++)
{
for(e=0;e<=10;e++)
{
gotoxy(13+s*5,3+e);textcolor(RED);cprintf("-");
}
}
}

void d()
{
int w,q;
for(q=0;q<=8;q++)
{
for(w=0;w<=55;w++)
{
gotoxy(10+w,5+q*2);textcolor(BLUE);cprintf("|");
}
}
}

void main()
{
int a,x,b,c;
clrscr();
for(x=24;x>=1;x--)
{
clrscr();
gotoxy(30,x);textcolor(random(9+2));cprintf("Multiplication Table");
delay(60);
}

d();
t();
for(a=1;a<=10;a++)
{
for(c=1;c<=10;c++)
{
b=c*a;
gotoxy(10+c*5,2+a*2);textcolor(WHITE);cprintf("%d",b);
}
}
getch();
}

Linear Search Using Pointers in C Programming Language

A  Linear Search Using Pointers in C Programming Language program was written by my close friend and fellow software engineer Sir Ernel Fadriquilan. Thank you for sharing your code Sir Ernel.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.


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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.




Thank you very much for your help and support.


Program Listing

//One Dimensional Array || Searching

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

char* arey[10];

void areyin()
{
int i;
printf("Enter 10 numbers:");
for(i=0;i<=9;i++)
{
printf("%d.",i+1);scanf("%s",&arey[i]);
}
}

void locate(char* a)
{
int i;
int found;
for(i=0;i<=9;i++)
{
if(strcmp(a,arey[i])==0)
{
found=1;
break;
}
else
found=0;
}
if(found==1)
printf("%s is inside the room. Seat number %d",a,i+1);
else
printf("Not found!");
}

void main()
{
char* num;
clrscr();
areyin();
printf("Enter number to locate:");scanf("%s",&num);
locate(num);
getch();
}