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.";
  
  
?>

Friday, April 27, 2018

Display Record in Perl and MySQL

This will be my first time to write a code to display records from MySQL using PERL as my programming language. I have to install  DBD-mysql library in order for me to connect PERL script into MySQL database. The code is very short 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.


Installation of DBD-mysql library in the ActivePerl directory

Display of Records using PERL and MySQL


Program Listing

display.cgi

#!"C:\perl\bin\perl.exe"


use CGI::Carp qw(warningsToBrowser fatalsToBrowser);

use DBI;
use CGI;

print "Content-type: text/html \n\n";

# MYSQL CONFIG VARIABLES
$host = "localhost";
$database = "payroll";
$tablename = "employees";
$user = "root";
$pw = "";

# PERL MYSQL CONNECT()

$driver = "DBI:mysql:database=$database;host=$host"; 
$connect = DBI->connect($driver, $user, $pw);

# SELECT DB
$run_query = $connect->prepare("SELECT * FROM $tablename");
$run_query->execute();


print "<h2> Display Record in Perl and MySQL </h2>";
print "<h3> Created By Mr. Jake R. Pomperada, MAED-IT </h3>";
print "<br>";
# HTML TABLE
print "<table border='1'><tr>
<th>ID</th>
<th>LAST NAME</th>
<th>FIRST NAME</th>
<th>POSITION</th>

</tr>";

# FETCHROW ARRAY

while (@results = $run_query->fetchrow_array()) {
print "<tr><td>"
.$results[0]."</td><td>"
.$results[1]."</td><td>"
.$results[2]."</td><td>"
.$results[3]."</td></tr>";
}

print "</table>";


employees.sql

-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 27, 2018 at 05:21 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `payroll`
--

-- --------------------------------------------------------

--
-- Table structure for table `employees`
--

CREATE TABLE `employees` (
  `id` int(11) NOT NULL,
  `lastname` varchar(200) NOT NULL,
  `firstname` varchar(200) NOT NULL,
  `position` varchar(200) NOT NULL,
  `dayswork` int(10) NOT NULL,
  `rate` decimal(10,2) NOT NULL,
  `salary` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `employees`
--

INSERT INTO `employees` (`id`, `lastname`, `firstname`, `position`, `dayswork`, `rate`, `salary`) VALUES
(30, 'BRYANT', 'KOBE', 'SENIOR MANAGER', 30, '123.73', '3711.90'),
(32, 'JORDAN', 'MICHAEL', 'CLERK', 10, '250.16', '2501.60'),
(33, 'MORENO', 'ALMA', 'SALES CONSULTANT', 15, '341.53', '5122.95'),
(34, 'PASCUAL', 'PIOLO', 'ACTOR', 13, '234.79', '3052.27'),
(45, 'UY', 'MIKE', 'CARPENTER', 14, '100.59', '1408.26'),
(46, 'POMPERADA', 'JAKE', 'SOFTWARE ENGINEER TEAM LEAD', 0, '0.00', '0.00'),
(47, 'POMPERADA', 'MA. JUNALLIE', 'SYSTEM ARCHITECT', 0, '0.00', '0.00'),
(48, 'POMPERADA', 'JACOB SAMUEL', 'SOFTWARE DEVELOPER / TESTER', 1, '1.00', '1.00'),
(49, 'POMPERADA', 'JULIANNA RAE', 'SOFTWARE MANAGER / QUALITY ASSURANCE MANAGER', 0, '0.00', '0.00'),
(50, 'POMPERADA', 'LYDIA', 'FINANCE MANAGER', 1, '11.00', '1.00'),
(51, 'POMPERADA', 'VIRGILIO', 'SOFTWARE DESIGNER AND TRAINOR', 1, '1.00', '1.00');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `employees`
--
ALTER TABLE `employees`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `employees`
--
ALTER TABLE `employees`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=52;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;



Diameter, Circumference and Area of a Circle in PERL

A very simple program to ask the user to give a value in radius and then our program will compute the diameter, circumference and area of a circle using PERL 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. 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

circle.pl


use Math::Round;

print "\n\n";
print "Diameter, Circumference and Area of a Circle in PERL";
print "\n\n";
print "Created By Mr. Jake R. Pomperada,MAED-IT";
print "\n\n";
print "What is the radius? : ";
$r = <>;
$diameter = (2 * $r);
$area = (3.1416 * ($r ** 2));
$circum = ($diameter * 3.14);

my $diameter2 = nearest(.1,$diameter); 
my $area2 = nearest(.1,$area);
my $circum2 = nearest(.1,$circum);

print "\n\n";
print "===== DISPLAY RESULT =====";
print "\n\n";
print "The diameter of the circle is $diameter2.";
print "\n\n";
print "The area of the circle is $area2. ";
print "\n\n";
print "The Circumference of the circle is $circum2.";
print "\n\n";
print "End of Program";
print "\n\n";