Saturday, December 7, 2019

Loan Interest Rate Solver in Go

I wrote this simple loan interest rate solve using Golang programming language to solve the loan of the customer in a lending institution.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.


Sample Program Output


Program Listing

/* interest.go
   Author : Mr. Jake R. Pomperada, MAED-IT
   Date   : December 7, 2018  Friday
 */

package main

import "fmt"
func main() {

var SI float64

fmt.Print("\n")
fmt.Print("\tLoan Interest Rate Solver")
fmt.Print("\n\n")
fmt.Print("\tGive Principal Amount PHP : ")
var principal float64
fmt.Scanf("%f\n",&principal)
fmt.Print("\tGive Time  : ")
var time float64
fmt.Scanf("%f\n",&time)

fmt.Print("\tGive Rate (%) : ")
var rate float64
fmt.Scanf("%f\n",&rate)

/* Calculate simple loan interest */
 SI = (principal * time * rate) / 100;

fmt.Print("\n")
fmt.Print("\tThe Interest is PHP ")
fmt.Printf("%0.2f \n", SI)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}



Crud Applications in PHP and MySQL

A simple crud applications using mysqli in PHP and MySQL that I wrote before in learning the PHP and MySQL Database programming.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.

Program Listing

db.php

<?php 

$host = "localhost";
$username = "";
$password = "";
$dbname = "";

$con = mysqli_connect($host, $username, $password, $dbname);

if (!$con) {
die("Connection failed" . mysqli_errno($con));
}

 ?>

index.php

<?php 

// including the database connection
//include_once 'db.php';


// Inserting data into the database if submit button is clicked
if (isset($_POST['submit'])) {
$first_name = $_POST['fname'];
$last_name = $_POST['lname'];
$email = $_POST['email'];
$date_of_birth = $_POST['dob'];

if (!empty($first_name && $last_name && $email && $date_of_birth)) {
$insert_query = mysqli_query($con, "INSERT INTO users(f_name, l_name, email, dob) VALUES('$first_name', '$last_name', '$email', '$date_of_birth')");
if ($insert_query > 0) {
$msg = "Successfully Added to the Database";
}else {
$msg = "Submission Failed";
}
}
}


// update data if update button is clicked
if (isset($_POST['update'])) {
  $first_name = $_POST['fname'];
  $last_name = $_POST['lname'];
  $email = $_POST['email'];
  $date_of_birth = $_POST['dob'];
  $hidden_id = $_POST['hidden_id'];

  if (!empty($first_name && $last_name && $email && $date_of_birth)) {
    
    $update_query = mysqli_query($con, "UPDATE users SET f_name ='$first_name', l_name ='$last_name', email ='$email', dob ='$date_of_birth' WHERE id ='$hidden_id'");
   
    if ($update_query > 0) {
     
      $msg = "Database record updated successfully";
    
     }else {
      $msg = "Update Failed";
    }
  }
}

 ?>


<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Crud Apllication</title>
    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/custom.css" rel="stylesheet">

    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootbox.min.js"></script>


</head>
 
 <body>

    <!-- Navigation -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
             <p class="" style="margin-left: 360px; color: white; padding-top: 6px; font-size: 20px;"><?php if (isset($msg)) echo $msg; ?></p>
            </div>
            
        </div>
        <!-- /.container -->
    </nav>

    <!-- Page Content -->
    <div class="container">

          <div class="row"> 
            <div class="col-md-12">
                <h1 class="page-header text-center">
                    CRUD APPLICATION
                    <small>Create, Read, Update & Delete Database Records</small>
            </div>

           </div>
        

            <form class="form-horizontal" action="" method="POST" >    
                <div class="form-group">
                    <div class="col-md-4 col-md-offset-2">
                        <input type="text" name="fname" class="form-control " placeholder="First Name" value="<?php if (isset($first_name)) echo $first_name;?>" auto="off">
                    </div>

                    <div class="col-md-4">
                        <input type="text" name="lname" class="form-control" placeholder="Last Name" value="<?php if (isset($last_name)) echo $last_name;?>">
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-4 col-md-offset-2">
                        <input type="email" name="email" class="form-control " placeholder="Email Address" value="<?php if (isset($email)) echo $email;?>">
                    </div>

                    <div class="col-md-4">
                        <input type="date" name="dob" class="form-control" placeholder="Date of Birth" value="<?php if (isset($dob)) echo $dob;?>">
                    </div>
                </div>
                <div class="form-group">
               <div class="col-md-8 col-lg-offset-2">
                <button class="btn btn-block btn-success btn-lg" name="submit" type="submit">Add Record<span class="glyphicon glyphicon-chevron-right"></span></button>
                </div>
               </div>
            </form>
           
            <hr>
       
        <div class="col-md-12">
            <table class="table table-striped table-bordered table-responsive">
                <thead>
                    <tr class="success">
                        <th>S/N</th>
                        <th>Full Name</th>
                        <th>Email</th>
                        <th>Date of Birth</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>

                <?php
                 /*$i = 0; 
                      $read_query = mysqli_query($con, "SELECT * FROM users");
                        while ($rows = mysqli_fetch_assoc($read_query)) { 
                        $i++; ?>
               
                      <tr>
                      <td><?php echo $i; ?></td>
                      <td><?php echo $rows['f_name']."&nbsp;".$rows['l_name']; ?></td>
                        <td><?php echo $rows['email']; ?></td>
                        <td><?php echo $rows['dob']; ?></td>
                        <td>
                            <a href="update.php?update=<?php echo $rows['id'];?>" class="btn btn-primary">Update</a>
                            &nbsp&nbsp
               <a class="delete text-danger" data-id="<?php echo $rows['id']; ?>" href="javascript:void(0)">
               <i class="glyphicon glyphicon-trash"></i>
               </a>
                        </td>
                       </tr>


                    <?php }*/    ?>

                 
                </tbody>
            </table>
        </div>

    </div>

</body>

<script src="js/myscript.js"></script>

</html>

delete.php

<?php

include_once 'db.php';
if ($_REQUEST['delete']) {
$d_id = $_REQUEST['delete'];
$delete_query = mysqli_query($con, "DELETE FROM users WHERE id='$d_id'");
        
        if ($delete_query > 0) {
echo "Product Deleted Successfully ...";
}
}


update.php

<?php 

// including the database connection
include_once 'db.php';


// show users details if update button is clicked
/*if (isset($_GET['update'])) {
  $update_id = $_GET['update'];
  $user_data = mysqli_fetch_assoc(mysqli_query($con, "SELECT * FROM users WHERE id='$update_id'"));
  $first_name = $user_data['f_name'];
  $last_name = $user_data['l_name'];
  $email = $user_data['email'];
  $dob = $user_data['dob'];
}*/


 ?>


<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Crud Application</title>
    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/custom.css" rel="stylesheet">
    
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>



</head>
 
 <body>

  <style type="text/css">
        body{
              padding-top: 30px;
        }
  </style>

    <!-- Navigation -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
             <p class="" style="margin-left: 350px; color: white; padding-top: 6px;"><?php if (isset($msg)) echo $msg; ?></p>
            </div>
            
        </div>
        <!-- /.container -->
    </nav>

    <!-- Page Content -->
    <div class="container">

          <div class="row">  <!-- Blog Entries Column -->
            <div class="col-md-12">
                <h1 class="page-header text-center">
                    CRUD APPLICATION
                    <small>Update Database Records</small>
            </div>

           </div>
        

            <form class="form-horizontal" action="index.php" method="POST" >    
                <div class="form-group">
                    <div class="col-md-4 col-md-offset-2">
                        <input type="text" name="fname" class="form-control " placeholder="First Name" value="<?php if (isset($first_name)) echo $first_name;?>">
                    </div>

                    <div class="col-md-4">
                        <input type="text" name="lname" class="form-control" placeholder="Last Name" value="<?php if (isset($last_name)) echo $last_name;?>">
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-4 col-md-offset-2">
                        <input type="email" name="email" class="form-control " placeholder="Email Address" value="<?php if (isset($email)) echo $email;?>">
                    </div>

                    <div class="col-md-4">
                        <input type="date" name="dob" class="form-control" placeholder="Date of Birth" value="<?php if (isset($dob)) echo $dob;?>">
                    </div>

                    <input type="hidden" name="hidden_id" value="<?php if (isset($_GET['update'])) echo $_GET['update']; ?>">

                </div>
                <div class="form-group">
               <div class="col-md-8 col-lg-offset-2">
                <button class="btn btn-block btn-info btn-lg" name="update" type="submit">Update Record<span class="glyphicon glyphicon-chevron-right"></span></button>
                <hr class="text-danger">
                </div>
               </div>
            </form>
           
            <hr>
    

    </div>

</body>

</html>



Miles To Kilometers Converter in Python

Here is a simple program that I wrote that will ask the user to give distance in Miles and then the program will convert the given miles value into its Kilometers equivalent.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.


Program Listing

def my_program():
   print()
   print("MILES TO KILOMETERS CONVERTER")
   print()
   miles = float(input("How many miles? : "))
   print()
   kilometers = (miles * 1.60934)
   print('%0.2f Mile(s) is equal to %0.2f Kilometer(s).' %(miles,kilometers))
   print("\n");
   repeat = input('Do you want to continue ? (Y/N) : ')

   if repeat.upper() == "N":
       print("\n")
       print("END OF PROGRAM")
       quit
   if repeat.upper() == "Y":
       my_program()

if __name__ == '__main__':
       my_program()


Try and Catch in Java

A simple program that I wrote using Java programming language to demonstrate the try and catch principle.

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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.


Program Listing

/**
 *
 * @author Mr. Jake R. Pomperada, MAED-IT
 * March 18, 2018 Sunday
 * Bacolod City, Negros Occidental
 */
public class JavaExceptions {
   
    public static void main(String[] args) {
        int number_value=0,a=0;
        try {
            number_value =0;
            a = (100/number_value);
            System.out.println("This will not be display.");
        } catch(ArithmeticException e) {
            System.out.println("Division By Zero !!!");
        } 
        System.out.println("After the Catch Statement");
        System.out.println();
        System.out.print("End of Program");
        System.out.println("\n\n");
    }
    } // end of Code
    


Exceptions in Java

In this article I would like to share with you guys a simple program to show how to perform basic exceptions in Java programming 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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.

Program Listing

package javaapplication1;

import java.util.Scanner;
import java.util.InputMismatchException;

/**
 *
 * @author Jake R. Pomperada,MAED-IT
 */
public class JavaApplication1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
      
            Scanner input = new Scanner(System.in);
      boolean success = false;
        while (!success) {
            try {
                System.out.print("Enter an integer: ");
                int num = input.nextInt();
                System.out.println("You entered " + num);
                success = true;
            } catch (InputMismatchException e) {
                input.next();
                System.out.println("You have entered invalid data");
            }
        }
         System.out.println("\n");
        System.out.print("\t END OF PROGRAM");
        input.close();
    }
    
}


Friday, December 6, 2019

Positive and Negative Number Checker in PERL


Create and design a program that will ask the user to give a number and then the problem will check and determine whether the given number is a positive or negative number and display the results on the screen.


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 City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My Facebook address is https://www.facebook.com/profile.php?...

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

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.


https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Thank you very much for your help and support.


Sample Program Output


Program Listing

# pos_neg.pl
# Author    : Jake Rodriguez Pomperada, MAED-IT
# Date        : December  6, 2019  Friday
# Tools       : Perl  5 and Visual Studio Code Version 1.40.2
# Websites : www.jakerpomperada.com  / www.jakerpomperada.blogspot.com
# Email       : jakerpomperada@gmail.com

print "\n";
print "\tPositive and Negative Number Checker in PERL";
print "\n\n";
print "\tGive a Number : ";
chomp($a =<>);
print "\n";

if ($a >=0) {
print "\tThe given number $a is a Positive number.";
} else {
    print "\tThe given number $a is a Negative number.";
}

print "\n\n";
print "\tEnd of Program";
print "\n\n";