Friday, April 27, 2018

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();
    }
}


Sunday, April 22, 2018

Sending Email in Java

Here is a program that I wrote using Java to send email the code works using Java API for email that is freely available in the Internet 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. 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

Sendingemail.java

package sendingemail;

import java.util.Properties;    
import javax.mail.*;    
import javax.mail.internet.*;



/**
 *
 * @author Jake R. Pomperada
 * Date April 22, 2018  Sunday
 * Bacolod City, Negros Occidental Philippines
 */

class Mailer{  
    public static void send(String from,String password,String to,String sub,String msg){  
          //Get properties object    
          Properties props = new Properties();    
          props.put("mail.smtp.host", "smtp.gmail.com");    
          props.put("mail.smtp.socketFactory.port", "465");    
          props.put("mail.smtp.socketFactory.class",    
                    "javax.net.ssl.SSLSocketFactory");    
          props.put("mail.smtp.auth", "true");    
          props.put("mail.smtp.port", "465");    
          //get Session   
          Session session = Session.getDefaultInstance(props,    
           new javax.mail.Authenticator() {    
           protected PasswordAuthentication getPasswordAuthentication() {    
           return new PasswordAuthentication(from,password);  
           }    
          });    
          //compose message    
          try {    
           MimeMessage message = new MimeMessage(session);    
           message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));    
           message.setSubject(sub);    
           message.setText(msg);    
           //send message  
           Transport.send(message);    
           System.out.println("Email Sending in Java");
           System.out.println();
           System.out.println("Your Email Sent successfully");  
           System.out.println();
           System.out.println("End of Program !!!");
          } catch (MessagingException e) {throw new RuntimeException(e);}    
             
    }  
}  

public class Sendingemail {

       public static void main(String[] args) {
    //from,password,to,subject,message  
     Mailer.send("jakerpomperada@gmail.com","yourpassword","jakerpomperada@gmail.com","My first email send in Java",
             "This is my first email send using Java !!! \n Thank you for using this Software \n "
                     + " Written By Mr. Jake R. Pomperada, MAED-IT");  
     //change from, password and to  
    }
    
}





Saturday, April 21, 2018

Login and Registration System in PHP and MySQLi

A very simple code that I wrote to demonstrate login and registration using PHP and MySQLI it supports the latest version of PHP 7.

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



DOWNLOAD SOURCE CODE HERE


Golden Star Enterprises Payroll System in PHP and MySQLIi

Here is a sample program that I wrote using PHP and MySQLi for a client before the will compute the salary of the employee in the company.

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





Basic CRUD Application in Java JDBC and MySQL

In this article I would like to share with you a collection of routine to implement CRUD application in Java using JDBC and MySQL.

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.


Program Listing


Jdbc.java


package com.jdbc.demo;

import java.sql.*;

public class Jdbc {

    private static Connection connection;

    // create table script
    // create table item(id int primary key auto_increment, name varchar(20), price double);

    public static void main(String[] args) throws Exception {

        String dbURL = "jdbc:mysql://localhost:3306/product";
        String username = "root";
        String password = "";

        try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();

            connection = DriverManager.getConnection(dbURL, username, password);

            if (connection != null) {
                System.out.println("Connected");
            }

            // insert record
            //insertItem("Pencil",5.50);
            //insertItem("Ballpen",9.00);

            //updateItem("Pencil",6.00);

            deleteItem("Pencil");
            // select records
            selectItems();


            connection.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void deleteItem(String name) throws Exception {
        String sql = "DELETE FROM Item WHERE name=?";

        PreparedStatement statement = connection.prepareStatement(sql);
        statement.setString(1, name);

        int rowsDeleted = statement.executeUpdate();
        if (rowsDeleted > 0) {
            System.out.println("An item was deleted successfully!");
        }
    }

    private static void updateItem(String name, Double price) throws Exception {
        String sql = "UPDATE Item SET price=? WHERE name=?";

        PreparedStatement statement = connection.prepareStatement(sql);
        statement.setDouble(1, price);
        statement.setString(2, name);

        int rowsUpdated = statement.executeUpdate();
        if (rowsUpdated > 0) {
            System.out.println("An existing item was updated successfully!");
        }
    }
    private static void selectItems() throws Exception {
        String sql = "SELECT * FROM Item";

        Statement statement = connection.createStatement();
        ResultSet result = statement.executeQuery(sql);

        int count = 0;

        while (result.next()){
            String name = result.getString(2);
            Double price = result.getDouble(3);

            String output = "Item #%d: %s - %s";
            System.out.println(String.format(output, ++count, name, price));
        }
    }

    private static void insertItem(String name, Double price) throws Exception {
        String sql = "INSERT INTO Item (name, price) VALUES (?, ?)";

        PreparedStatement statement = connection.prepareStatement(sql);
        statement.setString(1, name);
        statement.setDouble(2, price);

        int rowsInserted = statement.executeUpdate();
        if (rowsInserted > 0) {
            System.out.println("A new item was inserted successfully!");
        }
    }



}

Standard Hardware Payroll System in PHP and MySQL

This is a payroll system that I wrote to learn more about PHP and MySQL programming 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. 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.





Arrays in C

A very simple program in C that shows how to use arrays as your data structure.

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.


Program Listing

arrays.c

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

#define MAX 5

void insert ( int *, int pos, int num ) ;
void del ( int *, int pos ) ;
void reverse ( int * ) ;
void display ( int * ) ;
void search ( int *, int num ) ;

void main( )
{
int arr[5] ;

clrscr( ) ;

insert ( arr, 1, 11 ) ;
insert ( arr, 2, 12 ) ;
insert ( arr, 3, 13 ) ;
insert ( arr, 4, 14 ) ;
insert ( arr, 5, 15 ) ;

printf ( "\nElements of Array: " ) ;
display ( arr ) ;

del ( arr, 5 ) ;
del ( arr, 2 ) ;
printf ( "\n\nAfter deletion: " ) ;
display ( arr ) ;

insert ( arr, 2, 222 ) ;
insert ( arr, 5, 555 ) ;
printf ( "\n\nAfter insertion: " ) ;
display ( arr ) ;
reverse ( arr ) ;
printf ( "\n\nAfter reversing: " ) ;
display ( arr ) ;
search ( arr, 222 ) ;
search ( arr, 666 ) ;

getch( ) ;
}

/* inserts an element num at given position pos */
void insert ( int *arr, int pos, int num )
{
/* shift elements to right */
int i ;
for ( i = MAX - 1 ; i >= pos ; i-- )
arr[i] = arr[i - 1] ;
arr[i] = num ;
}

/* deletes an element from the given position pos */
void del ( int *arr, int pos )
{
/* skip to the desired position */
int i ;
for ( i = pos ; i < MAX ; i++ )
arr[i - 1] = arr[i] ;
arr[i - 1] = 0 ;
}

/* reverses the entire array */
void reverse ( int *arr )
{
int i ;
for ( i = 0 ; i < MAX / 2 ; i++ )
{
int temp = arr[i] ;
arr[i] = arr[MAX - 1 - i] ;
arr[MAX - 1 - i] = temp ;
}
}

/* searches array for a given element num */
void search ( int *arr, int num )
{
/* Traverse the array */
int i ;
for ( i = 0 ; i < MAX ; i++ )
{
if ( arr[i] == num )
{
printf ( "\n\nThe element %d is present at %dth position.", num, 
i + 1 ) ;
return ;
}
}

if ( i == MAX )
printf ( "\n\nThe element %d is not present in the array.", num ) ;
}

/* displays the contents of a array */
void display ( int *arr )
{
/* traverse the entire array */
int i ;
printf ( "\n" ) ;
for ( i = 0 ; i < MAX ; i++ )
printf ( "%d\t", arr[i] ) ;
}