Tuesday, May 1, 2018

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>

Sunday, April 29, 2018

Area of the Triangle in C++

Simple program to solve the area of the triangle written 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.



Program Listing

triangle.cpp

#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
    double b,h;

    cout<<"[ Area of a triangle ]"<<endl;
    cout<<"base  : "; cin>>b;
    cout<<"height: "; cin>>h;
    cout<<"area = "
        <<(b*h)/2
        <<" square units "
        <<endl;

    system("pause");
return 0;
}

Sum,Difference,Quotient,Product and Remainder in C++

A very  simple program to solve the Sum,Difference,Quotient,Product and Remainder 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.



Program Listing

math.cpp

#include<iostream>
#include<cstdlib>

using namespace std;

int main()
{
int x,y;
int s,d;

cout <<"Sum,Difference,Quotient,Product and Remainder in C++";
cout <<"\n\n";
cout<<"Enter x value: ";
cin>>x;
cout<<"Enter y value: ";
cin>>y;

    s = x + y;
    d = x - y;

    cout<<"\n sum        = "<<s
        <<"\n difference = "<<d
    <<"\n quotient   = "<<x/y
    <<"\n product    = "<<x*y
    <<"\n remainder  = "<<x%y
        <<endl;

    system("pause");
return 0;
}

Swap Two Numbers Using Pointers in C++

A very simple program to ask the user to give two numbers and swap the arrangement of the numbers using functions and pointers in C++ 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 <stdlib.h>

using namespace std;

void GetVal(int& Get1,int& Get2);
void SwapVal(int& Swap1,int& Swap2);
void ShowVal(int& Show1,int& Show2);

int main()
{
    int FirstNum,SecondNum;
    GetVal(FirstNum,SecondNum);
    SwapVal(FirstNum,SecondNum);
    ShowVal(FirstNum,SecondNum);
    system("PAUSE");
    return 0;
}

void GetVal(int& Get1,int& Get2)
{
 cout <<"SWAP TWO NUMBERS USING POINTERS AND FUNCTIONS IN C++";
cout << "Enter 2 values: ";
     cin >> Get1 >> Get2;
}

void SwapVal(int& Swap1,int& Swap2)
{
     int temp;
     temp = Swap1;
     Swap1 = Swap2;
     Swap2 = temp;
}

void ShowVal(int& Show1,int& Show2)
{
     cout << Show1 << "  " << Show2 << "\n";
}


Age Determiner in C++

A very simple age determiner using if - else statement 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.



Program Listing

age.cpp

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


int age main()

{


   cout<<"Enter age" ;
   cin>> age;
         if ((age>=0)&&(<=2))
         else if cout<< "baby"

         if ((age>=3)&&(<=5))
         else if cout<< "toddler"

         if ((age>=6)&&(<=12))
         else if cout<< "child"

         if ((age>=13)&&(<=15))
         else if cout<< "adolescent"

         if ((age>=16)&&(<=19))
         else if cout<< "teenager"

         if ((age>=20)&&(<=50))
         else if cout<< "adult"

         else cout<< "senior citizen"

      system("PAUSE");
      return 0;
}


Grade Checker in C++ Using If -Else Statement

A very simple program that will check for using grade using letter grade 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.



Program Listing

grade.cpp


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

int main()
{
          int grade;
          cout << "Enter grade: ";
          cin >> grade;
          if((grade>=95)&&(grade<=100))
              cout << "Grade is A\n";
          else if((grade>=87)&&(grade<=94))
              cout << "Grade is B\n";
          else if((grade>=80)&&(grade<=86))
              cout << "Grade is C\n";
          else if((grade>=75)&&(grade<=79))
              cout << "Grade is D\n";
          else if((grade>=60)&&(grade<=74))
              cout << "Grade is F\n";
          else
              cout << "Grade is INVALID!\n";

      system("PAUSE");
      return 0;
}



Length Conversion in C++

A very simple program written in C++ the will compute the different length conversion using functions and pointers.

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

convert.cpp

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

using namespace std;

void getval(int& feet,int& inch);
void convert(int& ftom,int& itocm);
void show(int& show1,int& show2);

int main()
{
    int x,y;
    getval(x,y);
    convert(x,y);
    show(x,y);
    system("PAUSE");
    return 0;
}

void getval(int& feet,int& inch)
{
     cout << "Length Conversion in C++";
cout << "Enter length in feet: ";
     cin >> feet;
     cout << " and in inches: ";
     cin >> inch;
}

void convert(int& ftom,int& itocm)
{                                         
     double mt;
     int fmt,fcm;
     
     mt=((ftom*12)+itocm)*2.54;
     fmt=mt;
     fcm=fmt%100;
     fmt=(fmt-fcm)/100;
     ftom=fmt;     
     itocm=fcm;
}

void show(int& show1,int& show2)
{
     cout << "\n\nThat is: " << show1 << " m & " << show2 << "cm\n\n";
}







Cube Number in PHP

Here is a simple program that I wrote in PHP to convert a number into cube equivalent.

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.php


<html>
 <title>Cube Number in PHP </title>
 <style>

  body {
       font-family:arial;
   font-weight:bold;
   size:15px;
   };
 </style>    
   
 <body>

<?php
  echo "<br>";
  echo "<h2>Cube a Number in PHP </h2>";
  echo "<p> Written By Mr. Jake R. Pomperada, MAED-IT </p>";
  
  $num1 = 8;
  
  $solve = ($num1 * $num1 * $num1);
  
  echo "<br>";
  echo "Display Result";
  echo "<br><br>";
  echo "The given number is ".$num1.".";
  echo "<br><br>";
  echo "The cube value of ".$num1." is " .$solve.".";

  
?>




Convert Day's Into Years and Weeks in PHP

A very simple program that I wrote to convert days into years and weeks using PHP as our programming language 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. 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.php

<html>
 <title>Convert Day's Into Years and Weeks in PHP </title>
 <style>

  body {
       font-family:arial;
   font-weight:bold;
   size:15px;
   };
 </style>    
   
 <body>

<?php
  echo "<br>";
  echo "<h2>Convert Day's Into Years and Weeks in PHP </h2>";
  echo "<p> Written By Mr. Jake R. Pomperada, MAED-IT </p>";
  
  $days = 789;
  
  $years = $days/365;
  $num1 = $days - ($years*365);
  $weeks=$days/7;
  $num1=$days-($weeks*7);
  
  echo "<br>";
  echo "Display Result";
  echo "<br><br>";
  echo "The given days is ".$days.".";
  echo "<br><br>";
  echo $days. " days = ".round($weeks,0)." weeks OR ".round($years,0)." years equivalent.";
  
  
?>