Thursday, May 3, 2018

POINTER TO FUNCTION IN C

Here is a simple code to show how to use pointers to function in C.

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

My email address are the following jakerpomperada@gmail.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.



Sample Program Output

Program Listing

pointers.c

/* May 2, 2018    */
/* Barangay Alijis, Bacolod City Negros Occidental Philippines */
/* Dev C++ */
/* Author : Mr. Jake R. Pomperada, MAED-IT */


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

void Add(int,int);
void Product(int,int);


int main() 
{
     int a=0,b=0;
     
     printf("======  POINTER TO FUNCTION IN C =====");
     printf("\n\n");
     printf("Created By Mr. Jake R. Pomperada, MAED-IT");
     printf("\n\n");
     printf("Give Two Numbers : ");
     scanf("%d%d",&a,&b);
           
     void (*pf)(int,int);
     
     pf = Add;
     
     (*pf)(a,b);
     
     pf = Product;
     
     (*pf)(a,b);
     
     
    printf("\n\n\n\n");
    printf("===== END OF PROGRAM =====");
    printf("\n\n");
    system("pause");
}
  

 void Add(int x,int y)
 {
      int c=0;
      c = x + y;
      printf("\n\n");
      printf("The sum is %d.",c);
}
         
 void Product(int x,int y)
 {
      int d=0;
      d = x * y;
      printf("\n\n");
      printf("The product is %d.",d);
}



Lucas Series in C

A very simple program that I wrote to compute the Lucas series using C language.

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

My email address are the following jakerpomperada@gmail.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.



Sample Program Output


Program Listing

lucas.c



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

int main() 
{
     int a=0,b=0,c=0,d=0,i=0,n=0;
     
     printf("======  LUCAS SERIES IN C =====");
     printf("\n\n");
     printf("Created By Mr. Jake R. Pomperada, MAED-IT");
     printf("\n\n");
     printf("Give Number of Terms : ");
     scanf("%d",&n);
     
     printf("\n\n");
     
     a=1;
     b=1;
     c=1;
     
     printf(" %d %d %d",a,b,c);
     
     for (i=1; i<=(n-3); i++) {
         d = a + b + c;
         printf(" %d", d);
         a=b;
         b=c;
         c=d;
    }
    printf("\n\n\n\n");
    printf("===== END OF PROGRAM =====");
    printf("\n\n");
    system("pause");
}
  
     


Password With Asterisk in C++

Here is a password security with asterisk masking that I wrote a long time ago in C++ using CodeBlocks. I hope you will find my work useful.

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

My email address are the following jakerpomperada@gmail.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.




Sample Program Output


Program Listing

password.cpp

// Password.cpp
// Author    : Mr. Jake Rodriguez Pomperada, MAED - Instructional Technology
// Date      : September 26, 2009 Saturday
// Email     : jakerpomperada@yahoo.com
// Tool      : Code Blocks 8.02
// Language  : C++

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

using namespace std;

const int PASSLEN = 4;

string passget();


void start()
{

string password;
cout << "\n\n";
cout << "\t PASSWORD SECURITY VERSION 1.0";
cout << "\n\n";
cout << "Enter Your Password: ";
password = passget();

if (password == "jake") {
    cout << "\n\n";
    cout << "Password Accepted";
    cout << "\n\n\n";
    cout << "\t\t Thank You For Using this Software";
    cout << "\n\n\t Created By: Mr. Jake Rodriguez Pomperada, MAED-IT";
        cout << "\n\n\t\t Date : September 26, 2009 Saturday";
}
else {
    cout << "\n\n";
    cout << "Password Denied Try Again !!!";
    start();
}
}  // End of Start Function


int main()
{
    start();
getch();
}

string passget()
{
char password[PASSLEN], letter;
int loop;
int len;
string password2;

//Get Password and replace letters with *--------------
loop = 0;
while(loop != PASSLEN)
{
password[loop] = '\0';
loop++;
}
loop = 0;
len = 0;
letter = '\0';
while( letter != '\r' )
{
letter = getch();
if( letter == '\b' && password[0] == '\0')
{
loop = 0;
len = 0;
}
else
{
if( letter == '\b' && password[0] != '\0')
{
cout << "\b";
cout << " ";
cout << "\b";
loop--;
password[loop] = '\0';
len--;
}
else
{
if( isprint( letter ) != 0 && loop < PASSLEN)
{
password[loop] = tolower(letter);
cout << "*" ;
}
loop++;
if (loop <= PASSLEN)
len++;
}
}
}

//Convert Password from character array to string
loop = 0;
len = len;
password2 = "";
while (loop != len)
{
password2 = password2+password[loop];
loop++;
}

return password2;
 } // End of Function Password


LinkedHashMap Collection Example in Java

Presently I am learning collections framework in Java in this sample program I will show you how to use LinkedHashMap. The code is very simple and easy to understand.

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

My email address are the following jakerpomperada@gmail.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.



Sample Program Output


Program Listing

LinkedHashMapExample.java


package javaapplication1;

import java.util.*;


/**
 *
 * @author : Mr. Jake R. Pomperada, MAED-IT
 * Date : May 3, 2018
 * Thurdsay
 * Barangay Alijis, Bacolod City Negros Occidental Philippines
 * jakerpomperada@yahoo.com and jakerpomperada@gmail.com
 *
 */

public class LinkedHashMapExample {
    
      public static void main(String[] args) {
       System.out.println("\n\n");
       System.out.println("LinkedHashMap Collection Example in Java");
       System.out.print("\n");
       
       LinkedHashMap <Integer,String>  set = new LinkedHashMap<Integer,String>();
       
       set.put(1,"Jake R. Pomperada");
       set.put(2,"Ma. Junallie F. Pomperada");
       set.put(3,"Jacob Samuel F. Pomperada");
       set.put(4,"Julianna Rae F. Pomperada");
       set.put(5,"Lydia R. Pomperada");
       set.put(6,"Virgilio V. Pomperada");
       
       
       for (Map.Entry m:set.entrySet()) {
           System.out.println(m.getKey() + " " + m.getValue());
       }
       System.out.print("\n\n");
       System.out.println("End of Program");
       System.out.print("\n\n");
    }
       
}




TreeMap Collection Example in Java

Presently I am learning collections framework in Java in this sample program I will show you how to use TreeMap. The code is very simple and easy to understand.

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

My email address are the following jakerpomperada@gmail.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.




Sample Program Output


Program Listing

Main.java

package javaapplication1;

import java.util.*;


/**
 *
 * @author : Mr. Jake R. Pomperada, MAED-IT
 * Date : May 3, 2018
 * Thurdsay
 * Barangay Alijis, Bacolod City Negros Occidental Philippines
 * jakerpomperada@yahoo.com and jakerpomperada@gmail.com
 *
 */
public class Main {
    
    public static void main(String[] args) {
       System.out.println("\n\n");
       System.out.println("TreeMap Collection Example in Java");
       System.out.print("\n");
       
      TreeMap <Integer,String>  set = new TreeMap <Integer,String>();
       
       set.put(1,"Jake R. Pomperada");
       set.put(2,"Ma. Junallie F. Pomperada");
       set.put(3,"Jacob Samuel F. Pomperada");
       set.put(4,"Julianna Rae F. Pomperada");
       set.put(5,"Lydia R. Pomperada");
       set.put(6,"Virgilio V. Pomperada");
       
       
       for (Map.Entry m:set.entrySet()) {
           System.out.println(m.getKey() + " " + m.getValue());
       }
       System.out.print("\n\n");
       System.out.println("End of Program");
       System.out.print("\n\n");
    }
       
}





Tuesday, May 1, 2018

Hello World in Assembly Language

I am starting learning assembly language programming in my spare time this sample program will display a hello world message on the screen including my name also. It is very basic assembly language program.

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

My email address are the following jakerpomperada@gmail.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.



Sample Program Output


Software used in writing this program


Program Listing

hello.asm

.MODEL SMALL

.STACK

.DATA

STRING DB 10, 13, "HELLO WORLD FROM JAKE R. POMPERADA, MAED-IT $" 

.CODE

MAIN PROC                                         

MOV AX, @DATA                                     

MOV DS, AX

LEA DX, STRING                                    

MOV AH, 09H                                       

INT 21H                                            

MOV AX, 4C00H                                      

INT 21H

MAIN ENDP                                         

END MAIN                                         



SWAP A NUMBER USING POINTERS IN C++

Here is a simple program to show how to use pointers to swap two numbers given by our user using C++ as our programming language.

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

My email address are the following jakerpomperada@gmail.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.



Program Listing

swap.cpp

#include <iostream>
#include <string>

 using namespace std;

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

 main() {

     int a=0,b=0,temp=0;
      char reply = 'Y';

 for (; toupper(reply)== 'Y'; ) {

 cout << "\n\n";
 cout << "\t\t SWAP A NUMBER USING POINTERS";
 cout << "\n\n\t Created By: Mr. Jake R. Pomperada, MAED-IT";
 cout << "\n\n";
 cout << "Enter the first value  :=> ";
 cin >> a;
 cout << "Enter the second value :=> ";
 cin >> b;

 cout << "\nOrignal value of a : " << a <<".";
 cout << "\nOrignal value of b : " << b <<".";

 cout << "\n\n";

 swap_value(&a,&b,temp);
 cout << "After calling the function Reference/Pointer";
 cout << "\n\n";

 cout << "\nNew value of a : " << a <<".";
 cout << "\nNew value of b : " << b <<".";
 cout << "\n\n";
 cout << "Do You Want To Continue Y/N :=> ";
 cin >> reply;

 }
 if (toupper(reply) == 'N') {
     cout << "\nThank You For Using This Program.";

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

Compound Interest Solver in JavaScript Version 2

A very simple compound interest solver in Javascript version 2 that I wrote while learning JavaScript programming.

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

My email address are the following jakerpomperada@gmail.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.




Sample Program Output

Program Listing

index.htm

<HTML>
<TITLE> COMPOUND INTEREST SOLVER IN JAVASCRIPT </TITLE>
<STYLE>

BODY {
   FONT-FAMILY:ARIAL;
   FONT-SIZE:15PX;
    };
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
var princ;
var ratepc;
var years;
var rate;
var power;
function calcAmt(frm) {
princ = eval(frm.pr.value);
ratepc = eval(frm.rt.value);
years = eval(frm.yr.value);
rate = ratepc / 100;
power = Math.pow((1 + rate), years);
frm.amt.value = Math.round(princ * power * 100) / 100;
frm.inter.value = Math.round((frm.amt.value - princ) * 100) / 100;
}
function checkInput(frm) {
if (rate == 0 || rate > .3) {
window.alert ("Are you sure that the interest rate is " + ratepc +"%?");
frm.rt.focus();
}
if (years == 0 || years > 30) {
window.alert ("Are you sure that the term is " + years + " years?");
frm.yr.focus();
   }
}
</script>

</HEAD>

<BODY BGCOLOR="LIGHTGREEN">

<BR>
<center>
<table width=600 cellpadding=0 cellspacing=10>
<tr>
<td width=468 align=center>

    
    
</td>
<td width=120 align=center>
    
</td>
</tr>
</table>
<BR>
<BR>
<basefont size=3>
<FONT SIZE="+2" FACE="Helvetica,Arial">
<FONT COLOR="blue"><b>Compound Interest Solver in JavaScript</b></font></font>
<BR>
<FONT COLOR="blue"><b>Written By. Mr. Jake R. Pomperada, MAED-IT</b></font></font>
<table BORDER=0 WIDTH=486 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE="helvetica,arial,geneva">
<br>

</td></tr>
</table>

<center>
<form method=get name=frm>
Principal <input type=text name=pr size=10 maxlength=10 onChange=calcAmt(this.form)>
Rate <input type=text name=rt size=6 maxlength=6 onChange=calcAmt(this.form)>
Years <input type=text name=yr size=5 maxlength=5 onChange=calcAmt(this.form)>
<br>
<br>
<input type=button name=calc value="Calculate" size=10 onClick=checkInput(this.form); calcAmt(this.form);>
<input type=reset value="Clear">
<br>
<br>
Amount <input type=text name=amt size=10>
Interest <input type=text name=inter size=10>
</form>
</center>
</BODY>
</HTML>