Monday, July 1, 2019

Java Payroll System Using Text File

Here is a simple Java Payroll System that uses a text files to store and process employees salary records.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Program Listing

payroll.java

// JAKE R. POMPERADA //
// July 1, 2019  //

import java.util.*;
import java.io.*;
import java.text.*;

class salary
{public double s(double rate,double hrs)
 {double sal=0;
  sal=(rate*hrs)/8;
  return sal;}
}
class time_in_hrs
{public int inhrs(int hrs)
 {int gen_in_minus=0;
  if(hrs<=805)
  {gen_in_minus=4;}
  else
  {gen_in_minus=12-(hrs/100);}
 return gen_in_minus;}
}
class time_out_hrs
{public int outhrs(int hrs)
 {int gen_out_minus=0;
  gen_out_minus=(hrs/100)-13;
  return gen_out_minus; }
}
class time_in_mins
{public double mins(int hrs)
 {int tmins=0;
  if(hrs<=805)
  {tmins=0;}
  else
  {tmins=hrs%100;}
  return tmins;}
}
class time_out_mins
{public double mouts(int hrs)
 {int tmins=0,m=0;
  tmins=hrs%100;
  if(tmins==0)
  {m=0;}
  else
  {m=60-tmins;}
  return m;}
}
class flxhrs
{public int flx_hrs(int hrs)
 {int gen_in_minus=0;
  gen_in_minus=hrs/100;
  return gen_in_minus;}
 }
class flx_mins_in
{public double flxmins(int hrs)
 {int tmins=0;
  if(hrs<805)
  {tmins=0;}
  else
  {tmins=hrs%100;}
  return tmins;}
 }
class flx_mins_out
{public double flxmouts(int hrs)
 {int tmins=0,m=0;
  tmins=hrs%100;
  if(tmins==0)
  {m=0;}
  else
  {m=60-tmins;}
  return m;}
 }

public class payroll
{ public static void main(String[] args) throws IOException
    {String read;
     double ss=0, rate=0;
     int lop;
     String day[]={"Monday","Tuesday","Wednesday","Thursday","Friday"};
     String in="",out="",date="";

     double mon_in_hrs=0, mon_out_hrs=0, mon_in_mins=0, mon_out_mins=0,
     total_flxhrs1=0, total_flxhrs2=0, total_mins1=0, total_mins2=0,
             a_flxhrs=0,total_hrs1=0,total_hrs2=0,
             a_hrs=0,overallmins=0,a_mins=0,overall=0,tothrs=0;

     salary sals = new salary();
     time_in_hrs tih = new time_in_hrs();
     time_out_hrs toh = new time_out_hrs();
     time_in_mins tim = new time_in_mins();
     time_out_mins tom = new time_out_mins();
     flxhrs fhrs = new flxhrs();
     flx_mins_in fminsin= new  flx_mins_in();
     flx_mins_out fminsout = new  flx_mins_out();

     FileReader fr = new FileReader("employee.txt");
     BufferedReader br = new BufferedReader(fr);
     FileWriter fw = new FileWriter("DTR.txt",true);
     BufferedWriter bw = new BufferedWriter(fw);
     NumberFormat nf = new DecimalFormat("###,##0.00");

     System.out.print("\n CODE: ");
     Scanner cod=new Scanner(System.in);
     String code = cod.next();

     while((read=br.readLine())!=null)
     {String arr[]=read.split(",");
      if(code.equals(arr[1]))
      {System.out.print("\nEmployee name  : "+arr[0]);
       System.out.print("\nEmployee code  : "+arr[1]);
       System.out.print("\nEmployee level : "+arr[2]);

       if(arr[2].equals("1"))
       {rate=480.00;
        System.out.print("\n Employee  rate : "+nf.format(rate));
       }
       if(arr[2].equals("2"))
       {rate=580.00;
        System.out.print("\n Employee rate : "+nf.format(rate));
       }
       if(arr[2].equals("3"))
       {rate=700.00;
        System.out.print("\n Employee rate : "+nf.format(rate));
       }
       arr[1] = arr[1]+""; bw.write(arr[1]);
       System.out.println("");
       for(lop=0;lop<5;lop++)
       {System.out.print("\nDTR FOR "+day[lop]);
        System.out.print("\nLog_in: ");
        Scanner lin = new Scanner(System.in);
        in = lin.next();
        System.out.print("Log_out: ");
        Scanner lout = new Scanner(System.in);
        out = lout.next();

        String r_arr[]=in.split(":"); String r_arr1[]=out.split(":");
        int mon_in = Integer.parseInt(r_arr[0]+r_arr[1]);
        int mon_out = Integer.parseInt(r_arr1[0]+r_arr1[1]);

        if(mon_in>=800 && mon_out <=1200)
        {mon_in_hrs=fhrs.flx_hrs(mon_in);
         mon_out_hrs=fhrs.flx_hrs(mon_out);
         mon_in_mins=fminsin.flxmins(mon_in);
         mon_out_mins=fminsout.flxmouts(mon_out);

         total_flxhrs1=total_flxhrs1+mon_in_hrs;
         total_flxhrs2=total_flxhrs2+mon_out_hrs;
         a_flxhrs=total_hrs2-total_hrs1;
         total_mins1= total_mins1+mon_in_mins;
         total_mins2= total_mins2+mon_out_mins;
        }else if(mon_in>=1300 && mon_out <=1700)
        {mon_in_hrs=fhrs.flx_hrs(mon_in);
         mon_out_hrs=fhrs.flx_hrs(mon_out);
         mon_in_mins=fminsin.flxmins(mon_in);
         mon_out_mins=fminsout.flxmouts(mon_out);

         total_flxhrs1=total_flxhrs1+mon_in_hrs;
         total_flxhrs2=total_flxhrs2+mon_out_hrs;
         total_mins1= total_mins1+mon_in_mins;
         total_mins2= total_mins2+mon_out_mins;
         }else{
         mon_in_hrs=tih.inhrs(mon_in);
         mon_out_hrs=toh.outhrs(mon_out);
         mon_in_mins=tim.mins(mon_in);
         mon_out_mins=tom.mouts(mon_out);
         total_hrs1=total_hrs1+mon_in_hrs;
         total_hrs2=total_hrs2+mon_out_hrs;
         total_mins1= total_mins1+mon_in_mins;
         total_mins2= total_mins2+mon_out_mins;
         }
        in = in+";"; out = out+";";
        bw.write(in); bw.write(out);

       a_hrs = total_hrs1+total_hrs2;
       a_flxhrs = total_flxhrs2-total_flxhrs1;
       overallmins = (total_mins1-total_mins2)/60;

       a_mins = a_hrs- overallmins;

       overall =a_mins+a_flxhrs;
       tothrs = overall;

       ss = sals.s(rate, tothrs);

       }
       System.out.print("\nPayroll date  : ");
       Scanner dte = new Scanner(System.in);
       date = dte.next();

       System.out.print("\nEEmployee name  : "+arr[0]);
       System.out.print("\nEmployee  code  : "+arr[1]);
       System.out.print("\nEmployee  level : "+arr[2]);
       System.out.print("\nEmployee  rate  : "+nf.format(rate));
       System.out.print("\nEmployee  hours : "+nf.format(tothrs));
       System.out.print("\nEmployee salary : "+nf.format(ss));
       System.out.print("\nPayroll  date   : "+date);
       System.out.println("");
     }

  }
fr.close(); bw.close();
}

}

DTR.txt

A02-00058:00;17:00;7:59;17:00;8:23;17:00;8:00;17:00;8:00;17:00;

employee.txt


Jake_Pomperada,A02-0001,2
Jacob_Samuel_Pomperada,A02-0002,3
Julianna_Rae_Pomperada,A02-0003,1
Allie_Pomperada,A0-0004,2
Lydia_Pomperada,A02-0005,3

Count Capital and Small Letters in JQuery

In this sample program, we will show you how to count the capital and small letters in a given sentence using JQuery a JavaScript library.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

Sample Program Output


Program Listing

<html>
  <head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <title>Count Capital and Small Letters in JQuery</title>
         <style>
        body{
font-family:arial;
font-size:15px;
font-weight:bold;
}  
</style>
        <script>
  $(function(){
$("#count").click(function(){
if (document.getElementById("str").value == '') {
alert("Textbox is Empty !!! Please provide some string.");
document.getElementById("str").value = "";
document.getElementById("upper_str").value = "";
document.getElementById("lower_str").value = "";
document.getElementById("str").focus();
                        }
else {
var str1 = document.getElementById("str").value;
    var numUpper = str1.length - str1.replace(/[A-Z]/g, '').length;  
var numLower = str1.length - str1.replace(/[a-z]/g, '').length;  
                        var result = document.getElementById("upper_str");
var result2 = document.getElementById("lower_str");
                        result.value = numUpper;
result2.value = numLower;
}
        });
});
                    
            $(function(){    
$("#clear").click(function(){
document.getElementById("str").value = "";
    document.getElementById("upper_str").value = "";
    document.getElementById("lower_str").value = "";
    document.getElementById("str").focus();
});
});
        </script>
  </head>
  <body>
      <br><br>
      <h3>Count Capital and Small Letters in JQuery</h3>
   <br>
        Enter a String <input type="text" id="str" name="str" value="" size="30" autofocus/>
        <br><br>
        <input type="button" name="Submit"  id="count" value="Count" title="Click here to count the capital and small letters."/>
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" name="Submit" id="clear" value="Clear" title="Click here to clear the text box."/>
<br><br><br><br>
        Number of Capital Letter(s) is  <input type="text" id="upper_str" name="upper_str" size="3"/>
<br><br>
Number of Small Letter(s) is  <input type="text" id="lower_str" name="lower_str" size="3"/>
  </body>
</html>







Money Bill Checker in Golang


Write and Design a program that will ask the user to give an amount and then the program will check and determine the money bill denomination based on the amount given by the user. The money bill denomination to be used in the program will be 500,100,50,20,10,5,2 and 1 bills.

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

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

/* bills.go
   Written By :
   Jake R. Pomperada
    April 3, 2019 Wednesday
   Bacolod City, Negros Occidental
*/
package main

import "fmt"

var amount int32

var note1000, note500, note100, note50 int32
var note20,note10 ,note5, note2, note1 int32

func main(){
fmt.Print("\n");
fmt.Print("\tMoney Bill Checker");
fmt.Print("\n\n");
fmt.Print("\tEnter amount: ")
    fmt.Scanln(&amount)
if (amount >= 1000) {
note1000 = amount/1000;
amount -= note1000 * 1000;
}
if (amount >= 500) {
note500 = amount/500;
amount -= note500 * 500;
}
if amount >= 100 {
note100 = amount/100;
amount -= note100 * 100;
   }
if(amount >= 50) {
note50 = amount/50;
amount -= note50 * 50;
}
if(amount >= 20){
note20 = amount/20;
amount -= note20 * 20;
}
if(amount >= 10) {
note10 = amount/10;
amount -= note10 * 10;
}
if(amount >= 5) {
note5 = amount/5;
amount -= note5 * 5;
}
if(amount >= 2) {
note2 = amount /2;
amount -= note2 * 2;
}
if (amount >= 1) {
note1 = amount;
}
fmt.Print("\n");
fmt.Print("\t===== DISPLAY RESULT =====\n\n");
fmt.Print("\t  Total number of notes  \n\n");
fmt.Print("\tPHP 1000 = ",note1000 ,"\n");
fmt.Print("\tPHP 500 =  ",note500,"\n");
fmt.Print("\tPHP 100 = ",note100,"\n");
fmt.Print("\tPHP 50 =  ",note50,"\n");
fmt.Print("\tPHP 20 =  ",note20,"\n");
fmt.Print("\tPHP 10 =  ",note10,"\n");
fmt.Print("\tPHP 5 =   ",note5,"\n");
fmt.Print("\tPHP 2 =   ",note2,"\n");
fmt.Print("\tPHP 1 =   ",note1,"\n");
fmt.Print("\n");
fmt.Print("\tEnd of Program");
fmt.Print("\n\n");
}


Electricity Billing System in C

About this code, I called it Electricity Billing System written entirely in C language. It is a database driven application that uses text files and struct data structure to store and manipulate records in the database. I created this code to show that it is not difficult to write database application using C language.


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

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output





Payroll System Using Swing in Java and MS Access


About this code, I called it  Payroll System  Using Swing in Java and MS Access it is a database driven application I wrote in Java. The Front End is Java and the depository of Data is MS Access as the Back End. It has also navigational buttons to navigate records in the Database. I have also incorporated the compute button to perform the calculation. This code is very useful for those you are new in JDBC programming in Java.

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

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output



Count Capital and Small Letters in JavaScript

In this sample program, we will show you how to count the capital and small letters in a given sentence using JavaScript. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output


Program Listing

<html>
  <head>
        <title>Count Capital and Small Letters in JavaScript</title>
         <style>
        body{
font-family:arial;
font-size:15px;
font-weight:bold;
}  
</style>
        <script language="javascript">
function count_all()
                {
                         if (document.getElementById("str").value == '') {
alert("Textbox is Empty !!! Please provide some string.");
document.getElementById("str").value = "";
document.getElementById("upper_str").value = "";
document.getElementById("lower_str").value = "";
document.getElementById("str").focus();
                        }
else {
var str1 = document.getElementById("str").value;
    var numUpper = str1.length - str1.replace(/[A-Z]/g, '').length;  
var numLower = str1.length - str1.replace(/[a-z]/g, '').length;  
                        var result = document.getElementById("upper_str");
var result2 = document.getElementById("lower_str");
                        result.value = numUpper;
result2.value = numLower;
}
                }
function clear_all()
{
document.getElementById("str").value = "";
document.getElementById("upper_str").value = "";
document.getElementById("lower_str").value = "";
document.getElementById("str").focus();
}
        </script>
  </head>
  <body>
      <br><br>
      <h3>Count Capital and Small Letters in JavaScript</h3>
   <br>
        Enter a String <input type="text" id="str" name="str" value="" size="30" autofocus/>
        <br><br>
        <input type="button" name="Submit" value="Count" onclick="javascript:count_all()"
title="Click here to count the capital and small letters."/>
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" name="Submit" value="Clear" onclick="javascript:clear_all()"
title="Click here to clear the text box."/>
<br><br><br><br>
        Number of Capital Letter(s) is  <input type="text" id="upper_str" name="upper_str" size="3"/>
<br><br>
Number of Small Letter(s) is  <input type="text" id="lower_str" name="lower_str" size="3"/>
  </body>
</html>

Sum of Two Numbers in JavaScript

In this article, I would like to share with you a sample program using HTML forms and JavaScript that allows the user to find the sum of the two numbers.

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


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output




Program Listing

<html>
  <head>
        <title>Addition of Two Numbers in JavaScript</title>
        <script language="javascript">
                function addNumbers()
                {
                        var val1 = parseInt(document.getElementById("value1").value);
                        var val2 = parseInt(document.getElementById("value2").value);
                        var ansD = document.getElementById("answer");
                        ansD.value = val1 + val2;
                }
        </script>
  </head>
  <body>
        value1 = <input type="text" id="value1" name="value1" value="1"/>
        value2 = <input type="text" id="value2" name="value2" value="2"/>
        <input type="button" name="Sumbit" value="Click here" onclick="javascript:addNumbers()"/>
        Answer = <input type="text" id="answer" name="answer" value=""/>
  </body>
</html>