Sunday, April 29, 2018

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












Student Grading System in Perl

Here is a simple program that I wrote in Perl programming language to solve the grades of the student. I made the code shorter and very 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.pl


use Math::Round;

print "\n\n";
print "Student Grading System in PERL";
print "\n\n";
print "Created By Mr. Jake R. Pomperada,MAED-IT";
print "\n\n";
print "Enter Prelim Grade  : ";
$prelim = <>;
print "Enter Midterm Grade  : ";
$midterm = <>;
print "Enter Final Grade  : ";
$final = <>;

$endterm = (($prelim * 0.2) + ($midterm * 0.3) + ($final * 0.5));

my $display_grade = round($endterm); 

print "\n\n";
print "===== DISPLAY RESULT =====";
print "\n\n";
print "Prelim Grade  : $prelim";
print "Midterm Grade : $midterm";
print "Final  Grade  : $final";
print "\n\n";
print "Endterm Grade : $display_grade";
print "\n\n";
print "End of Program";
print "\n\n";





Wednesday, April 25, 2018

HashSet Example in Java

Here is an example of Hashset data structure as a part of collection in Java that I wrote. 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.




Sample Program Output


Program Listing

HashSetExample.java

package hashsetexample;

import java.util.HashSet;

/**
 *
 * @author Mr. Jake R. Pomperada, MAED-IT
 * April 24, 2018  Tuesday
 */

public class HashSetExample {

       public static void main(String[] args) {
       System.out.println("Collections HashSet Example");
       System.out.println();
       System.out.println("Written By Mr. Jake R. Pomperada, MAED-IT");
       System.out.println();
       
       HashSet <Integer> sample = new HashSet<>();
      
       sample.add(10);
       sample.add(20);
       sample.add(30);
       sample.add(40);
       sample.add(50);
       sample.add(60);
       sample.add(70);
       sample.add(80);
       sample.add(90);
       sample.add(100);
       
       
       for (Integer obj:sample) {
            System.out.print(" "+ obj +"");
       }
       System.out.println("\n\n");
       System.out.println(" End of Program");
       System.out.println(); 
    }
}



Vector Collection in Java

In this article I would like to demonstrate how to implement vectors a data structure which belongs to collection libraries in java. The code is very short and easy to understand I hope you will learn something in here.

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


VictorsExample.java


package victorsexample;

import java.util.*;

/**
 *
 * @author Mr. Jake R. Pomperada, MAED-IT
 * April 24, 2018  Tuesday
 */
public class VictorsExample {

    public static void main(String[] args) {

       System.out.println("Collections Vectors Example");
       System.out.println();
       System.out.println("Written By Mr. Jake R. Pomperada, MAED-IT");
       System.out.println();

       Vector <Integer> sample = new Vector<>();
       
       sample.add(10);
       sample.add(20);
       sample.add(30);
       sample.add(40);
       sample.add(50);
       sample.add(60);
       sample.add(70);
       sample.add(80);
       sample.add(90);
       sample.add(100);
       
  
       Enumeration display = sample.elements();
       
       while (display.hasMoreElements()) {
           System.out.print(" "+ display.nextElement()+"");
       }
       System.out.println("\n\n");
       System.out.println(" End of Program");
       System.out.println();
    }
}