Saturday, August 10, 2019

Linda Marketing Payroll System in Java

Here is a sample payroll system that I wrote in Java a very long time ago. I hope you will find my work useful.

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

payroll123.java

import java.util.*;
import java.io.*;
import java.text.*;
class salary
{   public double sals(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 <= 814)
     {   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 <= 814){ 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 flx_hrs
{   public int flxinhrs(int hrs)
    {int gen_in_minus=0;
     gen_in_minus = hrs/100;  return gen_in_minus;   }
}
class flx_mins_in
{  public double flxminsin(int hrs)
    {   int tmins=0;
        if(hrs < 814)  { tmins=0; }
        else           { tmins = hrs % 100; }
        return tmins; }
}
class flx_mins_out
{  public double flxminsout(int hrs)
    {   int tmins=0,m=0;
        tmins = hrs % 100;
        if(tmins == 0) { m=0; }
        else
        { m = 60 - tmins;  }
          return m;   }
}

public class payroll123{

   public static void main(String[] args) throws IOException
    {
        String code, str;
        double rate=0,totalh=0,total=0;
        double salar=0;
       time_in_hrs nhrs1=new time_in_hrs();
       time_out_hrs ohrs1=new time_out_hrs();
       time_in_mins inmins1=new time_in_mins();
       time_out_mins outmins1=new time_out_mins();
       flx_hrs nnhrs1=new flx_hrs();
       flx_mins_in nmins1=new flx_mins_in();
       flx_mins_out omins1=new  flx_mins_out();
       salary sal1=new salary();
      int inhrs1,othrs1,total_hrs1=0,total_hrs2=0,total_flxhrs1=0,total_flxhrs2=0,a_flxhrs=0;
      double nnmins1,onmins1,total_mins1=0,total_mins2=0,totmins=0,summins=0,thm=0;
       double t1=0,t2=0,t3=0,t4=0,t5=0;


        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("\t\t Linda Marketing Payroll System");
        System.out.print("\n\n");
        System.out.print("Enter Code: ");
        Scanner sc = new Scanner(System.in);
        code = sc.next();


         while((str = br.readLine())!=null)
        {

          String[]arr = str.split(",");
            if (code.equals(arr[1]))
            {
                System.out.println("Employee name: "+arr[0]);
                System.out.println("Employee Code: "+arr[1]);
                System.out.println("Employee Level: "+arr[2]);
                if (arr[2].equals("1"))
                {
                    rate= 380.00;
                    System.out.println("Employee Rate: "+rate);

                }
                 if(arr[2].equals("2"))
                 {
                    rate= 480.00;
                    System.out.println("Employee Rate: "+rate);

                 }

                if (arr[2].equals("3"))
                  {
                    rate= 550.00;
                    System.out.println("Employee Rate: "+rate);

                }


                    System.out.println(" Monday");
                    System.out.print("   Log_in: ");
                    Scanner sc1 = new Scanner(System.in);
                    String loginmon = sc1.next();

                    String []arr1 = loginmon.split(":");
                    String comloginmon = arr1[0]+arr1[1];
                    int conloginmon = Integer.parseInt(comloginmon);

                     nnmins1=inmins1.mins(conloginmon);

                    System.out.println("  Monday ");
                    System.out.print("  Log_out: ");
                    Scanner sc2 = new Scanner(System.in);
                    String logoutmon = sc2.next();

                    String []arr2 = logoutmon.split(":");
                    String comlogoutmon = arr2[0]+arr2[1];
                    int conlogoutmon = Integer.parseInt(comlogoutmon);
                    onmins1=outmins1.mouts(conlogoutmon);


                    if(conloginmon>= 800 && conlogoutmon <= 1200)
          {
             inhrs1 = nnhrs1.flxinhrs(conloginmon);
             othrs1 =nnhrs1.flxinhrs(conlogoutmon);
             nnmins1 = nmins1.flxminsin(conloginmon);
             onmins1 = omins1.flxminsout(conlogoutmon);

             total_flxhrs1 = total_flxhrs1 + inhrs1;
             total_flxhrs2 = total_flxhrs2 + othrs1;
             a_flxhrs = total_hrs2 - total_hrs1;

             total_mins1 = total_mins1 + nnmins1;
             total_mins2 = total_mins2 + onmins1;
             totmins=total_mins1+total_mins2;
             summins=totmins/60;
            thm = (total_flxhrs2 - total_flxhrs1)-a_flxhrs;
           t1=(thm-summins);
          }

        else if(conloginmon>= 1300 && conlogoutmon <= 1700)
        {
            inhrs1= nnhrs1.flxinhrs(conloginmon);
            othrs1 = nnhrs1.flxinhrs(conlogoutmon);

            nnmins1 = nmins1.flxminsin(conloginmon);
            onmins1 = omins1.flxminsout(conlogoutmon);

            total_flxhrs1 = total_flxhrs1 + inhrs1;
            total_flxhrs2 = total_flxhrs2 + othrs1;

            total_mins1 = total_mins1 + nnmins1;
            total_mins2 = total_mins2 + onmins1;
            totmins=total_mins1+total_mins2;
             summins=totmins/60;
          t1=(total_flxhrs2 - total_flxhrs1)-summins;
        }
        else
        {
              inhrs1=nhrs1.inhrs(conloginmon);
              othrs1= ohrs1.outhrs(conlogoutmon);

              nnmins1= inmins1.mins(conloginmon);
              onmins1 = outmins1.mouts(conlogoutmon);

              total_hrs1= total_hrs1 + inhrs1;
              total_hrs2= total_hrs2 + othrs1;

              total_mins1 =total_mins1 + nnmins1;
              total_mins2= total_mins2 + onmins1;


              totmins=total_mins2+total_mins1;
              summins=totmins/60;
              a_flxhrs = total_hrs2 - total_hrs1;
              totalh=(inhrs1+othrs1);
              t1=totalh-summins;


               }

                    System.out.println(" Tuesday ");
                    System.out.print("   Log_in: ");
                    Scanner sc3 = new Scanner(System.in);
                    String logintues = sc3.next();

                    String []arr3 = logintues.split(":");
                    String comlogintues = arr3[0]+arr3[1];
                    int conlogintues = Integer.parseInt(comlogintues);

                     nnmins1=inmins1.mins(conlogintues);

                    System.out.println("  Tuesday");
                    System.out.print("    Log_out: ");
                    Scanner sc4 = new Scanner(System.in);
                    String logouttues = sc4.next();

                    String []arr4 = logouttues.split(":");
                    String comlogouttues = arr4[0]+arr4[1];
                    int conlogouttues = Integer.parseInt(comlogouttues);

                    onmins1=outmins1.mouts(conlogouttues);


                    if(conlogintues>= 800 && conlogouttues<= 1200)
          {
             inhrs1 = nnhrs1.flxinhrs(conlogintues);
             othrs1 =nnhrs1.flxinhrs(conlogouttues);
             nnmins1 = nmins1.flxminsin(conlogintues);

             onmins1 = omins1.flxminsout(conlogouttues);

             total_flxhrs1 = total_flxhrs1 + inhrs1;
             total_flxhrs2 = total_flxhrs2 + othrs1;
             a_flxhrs = total_hrs2 - total_hrs1;

             total_mins1 = total_mins1 + nnmins1;
             total_mins2 = total_mins2 + onmins1;
             totmins=total_mins1+total_mins2;
             summins=totmins/60;
            thm = (total_flxhrs2 - total_flxhrs1)-a_flxhrs;
          t2=(thm-summins);

          }

        else if(conlogintues>= 1300 && conlogouttues <= 1700)
        {
            inhrs1= nnhrs1.flxinhrs(conlogintues);
            othrs1 = nnhrs1.flxinhrs(conlogouttues);

            nnmins1 = nmins1.flxminsin(conlogintues);
            onmins1 = omins1.flxminsout(conlogouttues);

            total_flxhrs1 = total_flxhrs1 + inhrs1;
            total_flxhrs2 = total_flxhrs2 + othrs1;

            total_mins1 = total_mins1 + nnmins1;
            total_mins2 = total_mins2 + onmins1;
            totmins=total_mins1+total_mins2;
             summins=totmins/60;
            t2=(total_flxhrs2 - total_flxhrs1)-summins;

        }
        else
        {
              inhrs1=nhrs1.inhrs(conlogintues);
              othrs1= ohrs1.outhrs(conlogouttues);

              nnmins1= inmins1.mins(conlogintues);
              onmins1 = outmins1.mouts(conlogouttues);

              total_hrs1= total_hrs1 + inhrs1;
              total_hrs2= total_hrs2 + othrs1;

              total_mins1 =total_mins1 + nnmins1;
              total_mins2= total_mins2 + onmins1;

               a_flxhrs = total_hrs2 - total_hrs1;
                totmins=total_mins2+total_mins1;
                summins=totmins/60;
                totalh=(inhrs1+othrs1);
                t2=totalh-summins;
        }








                    System.out.println("(Wednesday)");
                    System.out.print("   Log_in: ");
                    Scanner sc5= new Scanner(System.in);
                    String loginwed = sc5.next();

                    String []arr5 = loginwed.split(":");
                    String comloginwed = arr5[0]+arr5[1];
                    int conloginwed = Integer.parseInt(comloginwed);

                     nnmins1=inmins1.mins(conloginwed);

                    System.out.println(" Wednesday ");
                    System.out.print(  "   Log_out: ");
                    Scanner sc6 = new Scanner(System.in);
                    String logoutwed = sc6.next();

                    String []arr6 = logoutwed.split(":");
                    String comlogoutwed = arr6[0]+arr6[1];
                    int conlogoutwed = Integer.parseInt(comlogoutwed);

                    onmins1=outmins1.mouts(conlogoutwed);


                    if(conloginwed>= 800 && conlogoutwed<= 1200)
          {
             inhrs1 = nnhrs1.flxinhrs(conloginwed);
             othrs1 =nnhrs1.flxinhrs(conlogoutwed);
             nnmins1 = nmins1.flxminsin(conloginwed);

             onmins1 = omins1.flxminsout(conlogoutwed);
             total_flxhrs1 = total_flxhrs1 +inhrs1;

             total_flxhrs2 = total_flxhrs2 + othrs1;
             a_flxhrs = total_hrs2 - total_hrs1;

             total_mins1 = total_mins1 + nnmins1;
             total_mins2 = total_mins2 + onmins1;

            totmins=total_mins1+total_mins2;
            summins=totmins/60;
            thm = (total_flxhrs2 - total_flxhrs1)-a_flxhrs;
            t3=(thm-summins);

          }

        else if(conloginwed>= 1300 &&  conlogoutwed<= 1700)
        {
            inhrs1= nnhrs1.flxinhrs(conloginwed);
            othrs1 = nnhrs1.flxinhrs(conlogoutwed);

            nnmins1 = nmins1.flxminsin(conloginwed);
            onmins1 = omins1.flxminsout(conlogoutwed);

            total_flxhrs1 = total_flxhrs1 + inhrs1;
            total_flxhrs2 = total_flxhrs2 + othrs1;

            total_mins1 = total_mins1 + nnmins1;
            total_mins2 = total_mins2 + onmins1;
            totmins=total_mins1+total_mins2;
             summins=totmins/60;
            t3=(total_flxhrs2 - total_flxhrs1)-summins;

        }
        else
        {
              inhrs1=nhrs1.inhrs(conloginwed);
              othrs1= ohrs1.outhrs(conlogoutwed);

              nnmins1= inmins1.mins(conloginwed);
              onmins1 = outmins1.mouts(conlogoutwed);

              total_hrs1= total_hrs1 + inhrs1;
              total_hrs2= total_hrs2 + othrs1;

              total_mins1 =total_mins1 + nnmins1;
              total_mins2= total_mins2 + onmins1;
              a_flxhrs = total_hrs2 - total_hrs1;
               totmins=total_mins2+total_mins1;
               summins=totmins/60;
               totalh=(inhrs1+othrs1);
                t3=totalh-summins;
        }







                     System.out.println(" Thursday ");
                    System.out.print("     Log_in: ");
                    Scanner sc7= new Scanner(System.in);
                    String loginthur = sc7.next();

                    String []arr7 = loginthur.split(":");
                    String comloginthur = arr7[0]+arr7[1];
                    int conloginthur = Integer.parseInt(comloginthur);

                     nnmins1=inmins1.mins(conloginthur);

                    System.out.println(" Thursday ");
                    System.out.print("   Log_out: ");
                    Scanner sc8 = new Scanner(System.in);
                    String logoutthur = sc8.next();

                    String []arr8 = logoutthur.split(":");
                    String comlogoutthur = arr8[0]+arr8[1];
                    int conlogoutthur = Integer.parseInt(comlogoutthur);

                    onmins1=outmins1.mouts(conlogoutthur);


                    if(conloginthur>= 800 && conlogoutthur<= 1200)
          {
             inhrs1 = nnhrs1.flxinhrs(conloginthur);
             othrs1 =nnhrs1.flxinhrs(conlogoutthur);
             nnmins1 = nmins1.flxminsin(conloginthur);

             onmins1 = omins1.flxminsout(conlogoutthur);
             total_flxhrs1 = total_flxhrs1 + inhrs1;

             total_flxhrs2 = total_flxhrs2 + othrs1;
             a_flxhrs = total_hrs2 - total_hrs1;

             total_mins1 = total_mins1 + nnmins1;
             total_mins2 = total_mins2 + onmins1;
             totmins=total_mins1+total_mins2;
             summins=totmins/60;
            thm = (total_flxhrs2 - total_flxhrs1)-a_flxhrs;
           t4=(thm-summins);

          }

        else if(conloginthur>= 1300 &&  conlogoutthur<= 1700)
        {
            inhrs1= nnhrs1.flxinhrs(conloginthur);
            othrs1 = nnhrs1.flxinhrs(conlogoutthur);

            nnmins1 = nmins1.flxminsin(conloginthur);
            onmins1 = omins1.flxminsout(conlogoutthur);

            total_flxhrs1 = total_flxhrs1 + inhrs1;
            total_flxhrs2 = total_flxhrs2 + othrs1;

            total_mins1 = total_mins1 + nnmins1;
            total_mins2 = total_mins2 + onmins1;
            totmins=total_mins1+total_mins2;
             summins=totmins/60;
          t4=(total_flxhrs2 - total_flxhrs1)-summins;

        }
        else
        {
              inhrs1=nhrs1.inhrs(conloginthur);
              othrs1= ohrs1.outhrs(conlogoutthur);

              nnmins1= inmins1.mins(conloginthur);
              onmins1 = outmins1.mouts(conlogoutthur);

              total_hrs1= total_hrs1 + inhrs1;
              total_hrs2= total_hrs2 + othrs1;

              total_mins1 =total_mins1 + nnmins1;
              total_mins2= total_mins2 + onmins1;
               a_flxhrs = total_hrs2 - total_hrs1;
               totmins=total_mins2+total_mins1;
               summins=totmins/60;
               totalh=(inhrs1+othrs1);
               t4=totalh-summins;
        }





                    System.out.println(" Friday ");
                    System.out.print("   Log_in: ");
                    Scanner sc9= new Scanner(System.in);
                    String loginfri = sc9.next();

                    String []arr9 = loginfri.split(":");
                    String comloginfri = arr9[0]+arr9[1];
                    int conloginfri = Integer.parseInt(comloginfri);

                     nnmins1=inmins1.mins(conloginfri);

                    System.out.println("  Friday");
                    System.out.print("   Log_out: ");
                    Scanner sc10 = new Scanner(System.in);
                    String logoutfri = sc10.next();

                    String []arr10 = logoutfri.split(":");
                    String comlogoutfri = arr10[0]+arr10[1];
                    int conlogoutfri = Integer.parseInt(comlogoutfri);

                    onmins1=outmins1.mouts(conlogoutfri);


                    if(conloginfri>= 800 && conlogoutfri<= 1200)
          {
             inhrs1 = nnhrs1.flxinhrs(conloginfri);
             othrs1 =nnhrs1.flxinhrs(conlogoutfri);
             nnmins1 = nmins1.flxminsin(conloginfri);

             onmins1 = omins1.flxminsout(conlogoutfri);
             total_flxhrs1 = total_flxhrs1 + inhrs1;

             total_flxhrs2 = total_flxhrs2 + othrs1;
             a_flxhrs = total_hrs2 - total_hrs1;

             total_mins1 = total_mins1 + nnmins1;
             total_mins2 = total_mins2 + onmins1;

              totmins=total_mins1+total_mins2;
             summins=totmins/60;
             thm = (total_flxhrs2 - total_flxhrs1)-a_flxhrs;
             t5=(thm-summins);

          }

        else if(conloginfri>= 1300 &&  conlogoutfri<= 1700)
        {
            inhrs1= nnhrs1.flxinhrs(conloginfri);
            othrs1 = nnhrs1.flxinhrs(conlogoutfri);

            nnmins1 = nmins1.flxminsin(conloginfri);
            onmins1 = omins1.flxminsout(conlogoutfri);

            total_flxhrs1 = total_flxhrs1 + inhrs1;
            total_flxhrs2 = total_flxhrs2 + othrs1;

            total_mins1 = total_mins1 + nnmins1;
            total_mins2 = total_mins2 + onmins1;
            totmins=total_mins1+total_mins2;
             summins=totmins/60;
           t5=(total_flxhrs2 - total_flxhrs1)-summins;

        }
        else
        {
              inhrs1=nhrs1.inhrs(conloginfri);
              othrs1= ohrs1.outhrs(conlogoutfri);

              nnmins1= inmins1.mins(conloginfri);
              onmins1 = outmins1.mouts(conlogoutfri);

              total_hrs1= total_hrs1 + inhrs1;
              total_hrs2= total_hrs2 + othrs1;

                total_mins1 =total_mins1 + nnmins1;
                 total_mins2= total_mins2 + onmins1;
                 a_flxhrs = total_hrs2 - total_hrs1;
                totmins=total_mins2+total_mins1;
                summins=totmins/60;
                totalh=(inhrs1+othrs1);
                t5=totalh-summins;

        }


                  total=(total_hrs1+total_hrs2)+(((total_flxhrs2 - total_flxhrs1)-summins));

                    System.out.print("TOTAL HOURS    : "+total);
                    salar=sal1.sals(rate, total);
                    System.out.println("\nTOTAL RATE : "+salar);

                   bw.write("CODE:"+arr[1]);
                   bw.write(","+loginmon);
                   bw.write(","+logoutmon);
                   bw.write(","+logintues);
                   bw.write(","+logouttues);
                   bw.write(","+loginwed);
                   bw.write(","+logoutwed);
                   bw.write(","+loginthur);
                   bw.write(","+logoutthur);
                   bw.write(","+loginfri);
                   bw.write(","+logoutfri+" ");

   }

   }
      bw.close();
   }

   }


employee.txt

Juan_De_La_Cruz,A001,1
Miriam_Bismonte,A002,1
Gloria_Macapagal,A003,3
Manny_Pacquiao,A004,3
Jose_Rizal,A005,2

dtr.txt

CODE:A001,8:00,15:00,8:00,15:00,8:00,1:00,8:00,15:00,8:00,15:00 CODE:A001,8:00,13:00,8:00,16:00,7:00,16:00,8:00,16:00,8:00,16:00 









Login Security System in Go and MySQL

Here is a simple web based login security system in Go and MySQL as our database.

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



Installing of MySQL Driver for Go


Insertion of User Name and Password in phpMyAdmin Control Panel


Login Page




Running the Program

Successfully login in the system


Sample Program Output


Program Listing

create_login.sql

create database login;
use login;
create table users(id int auto_increment primary key, username varchar(100), password varchar(100));
insert into users(username,password) values("admin",md5("admin"));

login.go

package main 

import (
    "database/sql"
    "net/http"
    "log"
    "text/template"
    _ "github.com/go-sql-driver/mysql"
    "crypto/md5"
    "encoding/hex"
)

type User struct {
    Id    int
    Name  string
    Password string
}

func dbConn() (db *sql.DB) {
    dbDriver := "mysql"
    dbUser := "root"
    dbPass := ""
    dbName := "login"
    db, err := sql.Open(dbDriver, dbUser+":"+dbPass+"@/"+dbName)
    if err != nil {
        panic(err.Error())
    }
    return db
}

var tmpl = template.Must(template.ParseGlob("templates/*"))

func main() {
    log.Println("Server started on: http://localhost:9090")
    http.HandleFunc("/", Index)
    http.HandleFunc("/login", Login)
    http.ListenAndServe(":9090", nil)
}

func Index(w http.ResponseWriter, r *http.Request) {
    tmpl.ExecuteTemplate(w, "Index", nil)
}

func Login(w http.ResponseWriter, r *http.Request) {

r.ParseForm()                     
    username := r.Form.Get("username") 
    p := r.Form.Get("password")

    password := GetMD5Hash(p)

    db := dbConn()
    sqlStmt := "SELECT * FROM Users WHERE username=? AND password=?"
    
    var id int
    row := db.QueryRow(sqlStmt,username,password)
    
    switch err := row.Scan(&id); err {
    case sql.ErrNoRows:
    tmpl.ExecuteTemplate(w, "Index", nil)
    default:
    tmpl.ExecuteTemplate(w, "Success", nil)
    }
    
    defer db.Close()
}

func GetMD5Hash(text string) string {
    hasher := md5.New()
    hasher.Write([]byte(text))
    return hex.EncodeToString(hasher.Sum(nil))
}


index.tmpl

{{ define "Index" }}
<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Login</title>
        <meta charset="UTF-8" />
    </head>
<body>
<form name="login" action="/login" method="POST">
<table>
<tr><td>Username<input type="text" name="username"/></td>
<tr><td>Password<input type="password" name="password"/></td>
<tr><td><input type="submit" value="Login"/></td>
</form>
</body>
</html>
{{ end }}

Success.tmpl

{{ define "Success" }}
<h1>Success</h1>
{{ end }}







Friday, August 9, 2019

Enum Statements in C

Here is a sample code that I wrote using the C programming language to show how to use enum statements.

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

enum_example.c

#include <stdio.h>

int main()
{
enum MONTH {Jan=0,Feb,Mar};
enum MONTH month = Mar;
printf("\n\n");
     printf("\tEnum Program Demonstration");
     printf("\n\n");

  if (month == 0) {
printf("\tValue of January.");
} else if (month == 1) {
printf("\tMonth is February.");
}
if (month == 2) {
printf("\tMonth is March.");
}
printf("\n\n");
     printf("\tEnd of Program");
     printf("\n\n");
}




Logical Operators in C

In this article, I would like to share with you a sample program to demonstrate how to use logical operators in the C programming language. Logical operators are very important in making conditions in any C programs.

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

logical_operators.c

/* logical.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 19, 2018  Monday 2:18 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@jakerpomperada.com
              jakerpomperada@gmail.com
              jakerpomperada@yahoo.com
              jakerpomperada@aol.com
*/

#include <stdio.h>

int main()
{
    int a=10, b=4, c=10, d=20;
    // logical AND example
    printf("\n\n");
    printf("\tLogical Operators Demonstration");
    printf("\n\n");
     if (a>b && c==d) {
      printf("\n");
      printf("\tA is greater than B AND C is equal to D.\n");
    }
    else {
    printf("\n");
    printf("\tAND condition not satisfied.\n");
   }
     // logical OR example
    if (a>b || c==d) {
    printf("\n");
    printf("\tA is greater than B OR C is equal to D.\n");
       }
    else 
    {
     printf("\n");
     printf("\tNeither A is greater than B nor C is equal to D.\n");
    }
    // logical NOT example
    if (!a) {
    printf("\n");
        printf("\tA is zero.\n");
    }
    else {
    printf("\n");
    printf("\tA is not zero.");
 }
printf("\n\n");
    printf("\tEnd of Program");
    printf("\n\n");
}





Local Variable in C

In this article, I would like to share with you how to declare and use local variables in C programming language. The code is very simple to understand and use. I am using Dev C++ as my C compiler in this program.

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

local_variables.c


#include <stdio.h>

int main()

    {
     // Local variable declaration
    int a=0, b=0;
    int product=0;
     // actual variable initialization by assigning values.
     a = 5;
     b =  10;
     product = ( a * b);
     printf("\n\n");
     printf("\tLocal Variable Declaration Program");
     printf("\n\n");
     printf("\tThe product of %d and %d is %d.",a,b,product);
     printf("\n\n");
     printf("\tEnd of Program");
     printf("\n\n");
     return 0;
}

Basic String Input Program in Go


Write a program to print the following output.

Basic String Input Program in Go

What is your name?   : jacob samuel fuentebella pomperada [This line will be given by the user]

Hello JACOB SAMUEL FUENTEBELLA POMPERADA

How are you today?

End of Program

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

/* string_exampple_one.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 4, 2019  Sunday  5:10 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"os"
"strings"
)

func main() {
consoleReader := bufio.NewReader(os.Stdin)
fmt.Print("\n")
fmt.Print("\tBasic String Input Program in Go")
fmt.Print("\n\n")
fmt.Print("\tWhat is your name?   : ")
user_name, _ := consoleReader.ReadString('\n')
fmt.Print("\n")

name_display := strings.ToUpper(user_name)

fmt.Printf("\tHello %s",name_display)
fmt.Print("\n")
fmt.Println("\tHow are you today?")
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}




Remove Consonants in a String in Go

Write a program that will ask the user to give a string and then the program will remove the consonants in the given string and display the results on the screen in Golang.

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

/* remove_consonants.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 5, 2019  Monday 4:34 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"log"
"os"
"regexp"
"strings"
)


func main() {
consoleReader := bufio.NewReader(os.Stdin)
fmt.Print("\n")
fmt.Print("\tRemove Consonants in a String")
fmt.Print("\n\n")
fmt.Print("\tGive a String : ")
str, _ := consoleReader.ReadString('\n')
fmt.Print("\n")

reg, err := regexp.Compile("[^aeiou]+")
if err != nil {
log.Fatal(err)
}
str_results := reg.ReplaceAllString(str, "")
display := strings.ToUpper(str_results)

fmt.Print("\tDISPLAY THE RESULTS")
fmt.Print("\n\n")
fmt.Printf("\tThe given String :  %s",str)
fmt.Print("\n")
fmt.Printf("\tThe string after consonants has been removed")
fmt.Print("\n\n")
fmt.Print("\t",display)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}