Wednesday, April 3, 2019

Highest of the Three Numbers in Go

This sample program will ask the user to give three numbers and then the program will check which of the three numbers is the highest in terms of numerical value written in Go 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 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

package main

import "fmt"

var n1,n2,n3 int32

func main(){
fmt.Print("\n");
fmt.Print("\tHighest of the Three Numbers");
fmt.Print("\n\n");
fmt.Print("\tGive Three Numbers : ");
fmt.Scanln(&n1,&n2,&n3)
if(n1 >= n2 && n1 >= n3) {
fmt.Print("\n");
fmt.Print("\tThe highest number is ",n1,".");
}
if(n2 >= n1 && n2 >= n3) {
fmt.Print("\n");
fmt.Print("\tThe highest number is ",n2,".");
}
if(n3 >= n1 && n3 >= n2) {
fmt.Print("\n");
fmt.Print("\tThe highest number is ",n3,".");
}
fmt.Print("\n\n");
fmt.Print("\tEnd of Program");
fmt.Print("\n");
}



Automatic Teller Machine Simulation in Go

Here is a sample program that we wrote to simulate automatic teller machine using Go programming language. I hope you will find our code useful in learning Go.

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

/* atm.go   Written By :   Jake R. Pomperada   Rollyn M. Moises   Sunday Vince V. Latergo   April 3, 2019 Wednesday   Bacolod City, Negros Occidental*/
package main

import "fmt"
var bill1000,bill500,bill100,bill200,total_balance int32;
var withdraw, money_left int32;
var recieve1000,recieve500,recieve200,recieve100 int32;

func main(){
   fmt.Print("\n");
   fmt.Print("\tAutomatic Teller Machine Simulation");
   fmt.Print("\n\n");
   fmt.Print("\tHow many P1000 bills: ");
   fmt.Scanln( &bill1000);
   fmt.Print("\tHow many P500 bills: ");
   fmt.Scanln(&bill500);
   fmt.Print("\tHow many PHP 200 bills: ");
   fmt.Scanln(&bill200);
   fmt.Print("\tHow many PHP 100 bills: ");
   fmt.Scanln(&bill100);
   total_balance = (bill1000 * 1000)+(bill500 * 500) + (bill200 * 200) +  (bill100 * 100) ;
   fmt.Print("\n\n");
   fmt.Print("\tTotal Balance: PHP ", total_balance);
   fmt.Print("\n\n");
      fmt.Print("\tEnter amount to withdraw: PHP ");
      fmt.Scanln(&withdraw);
      money_left = withdraw ;
      if  (withdraw > total_balance) {
         fmt.Print("\tWithdraw amount greater than total balance.  ");
         fmt.Print("\n");
      }
      if (withdraw < total_balance)     {

         if  (money_left >= 1000 ) {
            recieve1000 = (money_left / 1000);
            if (recieve1000 > bill1000) {
               recieve1000 = bill1000;
               money_left = money_left - (recieve1000 * 1000);
               bill1000 = bill1000 - recieve1000;
            }
         }
      }
         if  (money_left >= 500 )   {
            recieve500 = (money_left / 500);
            if (recieve500 > bill500 ) {
               recieve500 = bill500;
            }
            money_left = money_left - (recieve500 * 500);
            bill500 = bill500 - recieve500;
         }

         if (money_left >= 200 ) {
            recieve200 = (money_left / 200);
            if (recieve200 > bill200) {
               recieve200 = bill200;
               money_left = money_left - (recieve200 * 200);
               bill200 = bill200 - recieve200;
            }
         }

         if (money_left >= 100 )    {
            recieve100 =(money_left / 100);
            if (recieve100 > bill100 ) {
               recieve100 = bill100;
            }
            money_left = money_left - (recieve100 * 100);
            bill100 = bill100 - recieve100;
         }

         fmt.Print("\tYou will receive:");
         fmt.Print("\n");
         fmt.Print("\tPHP 1000 bill :=> ", recieve1000);
         fmt.Print("\n");
         fmt.Print("\tPHP 500 bill :=>  ", recieve500);
         fmt.Print("\n");
         fmt.Print("\tPHP 200 bill :=>  ", recieve200);
         fmt.Print("\n");
         fmt.Print("\tPHP 100 bill :=>  ", recieve100);
         fmt.Print("\n\n");

         total_balance = total_balance - withdraw;

         fmt.Print("\tYour current balance is: PHP ",total_balance);
         fmt.Print("\n");
         fmt.Print("\tYou only have balance of:");
         fmt.Print("\n");
         fmt.Print("\tPHP 1000 bill :=> ",bill1000);
         fmt.Print("\n");
         fmt.Print("\tPHP 500 bill  :=> ",bill500);
         fmt.Print("\n");
         fmt.Print("\tPHP 200 bill  :=> ",bill200);
         fmt.Print("\n");
         fmt.Print("\tPHP 100 bill  :=> ",bill100);
         fmt.Print("\n\n");
         fmt.Print("\tEnd of Program");
         fmt.Print("\n");
}





Wednesday, March 27, 2019

Student Information System Using Python Flask and MySQL

Here is a simple program that we wrote using Python Flask and MySQL a simple student information system to store student name, email, and phone number. This will be our first web application written in Python and MySQL.

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






Monday, March 25, 2019

EMPLOYEES INFORMATION SYSTEM IN PYTHON AND SQLITE

Here is my first database application that uses Python and SQLITE I called this program EMPLOYEES INFORMATION SYSTEM IN PYTHON AND SQLITE which allows the user to add,edit,delete,view and quit the program. The code is very simple yet easy to understand. I wrote this program for our upcoming book on Python programming with my best friend Mr. Rollyn M. Moises as my co-author. 

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

crud.py

"""
Simple CRUD in Python and SQLite
Authors :
Mr. Rollyn  M. Moises,MSCS
Mr. Jake R. Pomperada,MAED-IT
Date : March 25, 2019   Monday
Location :Bacolod City, Negros Occidental Philippines
"""

import sqlite3
import os

def create_table():
 conn = sqlite3.connect('employees.sqlite')

 cursor = conn.cursor()

 query = '''
     CREATE TABLE IF NOT EXISTS employee(
      id INTEGER PRIMARY KEY, 
      emp_id INTEGER, 
      name TEXT,
   position TEXT,
         department TEXT,
   salary TEXT
     )
 '''

 cursor.execute(query)
 conn.commit()
 conn.close()

def add_employee(emp_id,name,position,department,salary):
 conn = sqlite3.connect('employees.sqlite')

 cursor = conn.cursor()

 query = '''
     INSERT INTO employee(emp_id,name,position,department,salary)
              VALUES (?,?,?,?,?)
 '''
 cursor.execute(query,(emp_id,name.upper(),position.upper(),department.upper(),salary))
 conn.commit()
 conn.close()

def get_employees():
 conn = sqlite3.connect('employees.sqlite')

 cursor = conn.cursor()

 query = '''
     SELECT  emp_id,name,position,department,salary
     FROM employee
 '''

 cursor.execute(query)
 all_rows = cursor.fetchall()
 conn.commit()
 conn.close()
 return all_rows

def get_employee_by_emp_id(emp_id):
 conn = sqlite3.connect('employees.sqlite')
 cursor = conn.cursor()
 query = '''
     SELECT emp_id, name, position,department,salary
     FROM employee
     WHERE emp_id = {}
 ''' .format(emp_id)
 cursor.execute(query)
 all_rows = cursor.fetchall()
 conn.commit()
 conn.close()
 return all_rows

def update_employee(emp_id,name,position,department,salary):
 conn = sqlite3.connect('employees.sqlite')
 cursor = conn.cursor()
 query = '''
     UPDATE employee
     SET name = ?, position = ?,department = ?, salary = ?
     WHERE emp_id = ?
 '''
 cursor.execute(query,(name.upper(),position.upper(),department.upper(),salary.upper(),emp_id))
 conn.commit()
 conn.close()

def delete_employee(emp_id):
 conn = sqlite3.connect('employees.sqlite')
 cursor = conn.cursor()
 query = '''
     DELETE
     FROM employee
     WHERE emp_id = {}
 ''' .format(emp_id)

 cursor.execute(query)
 all_rows = cursor.fetchall()
 conn.commit()
 conn.close()
 return all_rows

create_table()


def add_data(id_,name,position,department,salary):
 add_employee(id_,name,position,department,salary)
def get_data():
 return get_employees()

def show_data():
 employees_record = get_data()
 for emp in employees_record:
  print(emp)

def show_data_by_id(id_):
 employees_record = get_employee_by_emp_id(id_)
 if not employees_record:
  print("No Data Found at emp_id",id_)
 else:
  print (employees_record)

def option():
 os.system('cls')
 print()
 print("\tEMPLOYEES INFORMATION SYSTEM IN PYTHON AND SQLITE")
 print()
 print("\t1.ADD RECORD \n\t2.SHOW RECORD\n\t3.FIND RECORDS\n\t4.EDIT RECORDS\n\t5.ERASE RECORDS\n\t6.QUIT PROGRAM")
 print()
 select_option= input("\tSELECT YOUR CHOICE ==> ")
 print()
 
 if select_option=='1':
  os.system('cls')
  id_emp = int(input('\tGive Employees ID : '))
  name = input('\tName: ')
  position = input('\tPosition: ')
  department = input('\tDepartment: ')
  salary = input('\tSalary: ')
  add_data(id_emp,name,position,department,salary)
  input("\n\tYour record has been saved.\n\tPRESS ENTER KEY TO RETURN TO MAIN MENU")
  option()
 elif select_option=='2':
  os.system('cls')
  show_data()
  input("\n\tPRESS ENTER KEY TO RETURN TO MAIN MENU")
  option()
 elif select_option=='3':
  os.system('cls')
  id__ = int(input('\tEnter Employees ID: '))
  show_data_by_id(id__)
  input("\n\tPRESS ENTER KEY TO RETURN TO MAIN MENU")
  option()
 elif select_option=='4':
  os.system('cls')
  id_emp = int(input('\tEnter Employees ID: '))
  show_data_by_id(id_emp)
  print()
  name = input('\tName: ')
  position = input('\tPosition: ')
  department = input('\tDepartment: ')
  salary = input('\tSalary: ')
  update_employee(id_emp,name,position,department,salary)
  input("\nYour data has been updated. \n\tPRESS ENTER KEY TO RETURN TO MAIN MENU")
  option()
 elif select_option=='5':
  os.system('cls')
  id_emp = int(input('\tEnter Employees ID: '))
  show_data_by_id(id_emp)
  delete_employee(id_emp)
  input("\n\tYour record has been deleted. \n\tPRESS ENTER KEY TO RETURN TO MAIN MENU")
  option()
 else:
   print()
   print("\tTHANK YOU FOR USING THIS SOFTWARE.")
   return 0;
   return 1;

while(option()):
 pass


DOWNLOAD SOURCE CODE HERE

Friday, March 15, 2019

Two Number Checker Using Python

Write a program that will ask the user to give two numbers and then the program will determine which of the two number is higher, lower or they are just the same numerical value.

Program Listing

# Rollyn M. Moises and Jake R. Pomperada
# two_numbers.py
# February 7, 2019  Thursday
# Bacolod City, Negros Occidental
print();
print("\t Two Number Checker ");
print();
x = int(input("\tEnter First  Value : "));
y = int(input("\tEnter Second Value : "));
if x < y:
    print();
    print("\t{0} is less than {1}.".format(x,y));
else:
    if x > y:
        print();
        print("\t{0} is greater than {1}.".format(x,y));
    else:
        print();
        print("\t{0} and {1} must be equal.".format(x,y));
print();
print("\tEND OF PROGRAM");

Largest of Three Numbers Using Nested IF Else In Python


Design a program that will ask the user to give three numbers using nested if statement. The program will check which of the three number has the highest numerical value and display the result on the screen.


Program Listing


# Rollyn M. Moises and Jake R. Pomperada
# bigger.py
# February 7, 2019  Thursday
# Bacolod City, Negros Occidental
print();
print("\tLargest of Three Numbers Using Nested IF Else ");
print();
a = int(input("\tEnter first number: "))
b = int(input("\tEnter second number: "))
c = int(input("\tEnter third number: "))
if (a > 0 and b > 0 and c > 0 ) :
 if (a >= b) and (a >= c):
   largest = a;
elif (b >= a) and (b >= c):
   largest = b;
else:
   largest = b;
print();
print("\tThe largest number between {0},{1} and {2} is {3}.".format(a,b,c,largest));
print();

print("\tEND OF PROGRAM");


Shipping Cost Solver in Python

Write a program that will ask the user the county of origin of the shipment of the package and it's weight in kilograms and then the program will compute its shipping cost by the sender and the display the result on the screen using nested if statement.


Program Listing

# Rollyn M. Moises and Jake R. Pomperada
# shipping.py
# February 7, 2019  Thursday
# Bacolod City, Negros Occidental
print();
print("\tShipping Cost Solver");
print();
country = input("\tWhat country : ");
weight = int(input("\tWeight in Kilogram(s) :"));
print();

if country == "japan":
    if weight <= 50:
        print("\tShipping Cost is  $250");
elif weight >= 100:
        print("\tShipping Cost is $375");
elif weight <= 20:
   print("\tShipping Costs $100");
if country == "thailand":
if weight >= 50:
         print("\tShipping Cost is  $100");
else:
    print("\tFREE");
print();
print("\tEND OF PROGRAM");



Thursday, March 14, 2019

Input and Output Program in Python

Here is a sample program that we wrote in Python to show you basic input and output. The code is very simple and easy to understand.

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

# variables.py# Written By Rolly M. Moises and Jake R. Pomperada
# Tools : PyCharm 2018.3.5 Community Edition# March 14, 2019     Thursday   8:21 AM
# Bacolod City, Negros Occidental
print()
print("\tBacolod Software Inc. Employee's Information System")
print()

full_name =input("\tGive Employee's Name             : ")
age = int(input("\tGive Employee's Age              : "))
position=input("\tGive Employee's Position         : ")
wage= input("\tWhat is Employee's Wage          : ")
wage2 = float(wage)
yearly_salary=input("\tWhat is Employee's Yearly Salary : ")
yearly_salary2 = float(yearly_salary)
gender=input("\tWhat is Employee's Gender        : ")

print()
print("\t ===== DISPLAY RESULT =====")
print()
print("\t Employee's Name           :",full_name.upper())
print("\t Employee's Age            : {0}".format(age))
print("\t Employee's Position       :",position.upper())
print("\t Employee's Wage           : PHP %.2f" % round(wage2,2))
print("\t Employee's Yearly Salary  : PHP %.2lf" % round(yearly_salary2,2))
print("\t Employee's Gender         :",gender.upper())
print()
print("\t ===== END OF PROGRAM =====")
print()

Friday, March 8, 2019

Fibonacci Series Using Functions in Python

A simple program we wrote in Python using a function to generated Fibonacci series.

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

#fibonacci.py
# Written By Jake R. Pomperada and Rollyn M. Moises
# Date : February 27, 2019   Wednesday
# Bacolod City, Negros Occidental

def fibonacci(n):
    if(n <= 1):
        return n
    else:
        return(fibonacci(n-1) + fibonacci(n-2))

print();
print("\tFibonacci Series Using Functions");
print();
n = int(input("\tEnter number of terms : "));
print();
print("\tFibonacci Sequence")
print();
for i in range(n):
 print('\t',fibonacci(i),end='');
print("\n");
print("\tEnd of Progra



Simple Calculator Program in Python Using Function

A simple calculator program we wrote using Python and functions. The code is very simple and easy to understand.

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


# calculator.py
# Rollyn M. Moises and Jake R. Pomperada
# February 27, 2019    Wednesday
# Bacolod City, Negros Occidental

def menu():
    print();
    print("\t\t Simple Calculator Program");
    print();
    print("\tWritten By Rollyn M. Moises and Jake R. Pompreada")
    print();
    print("\t1. Addition");
    print("\t2. Subtraction");
    print("\t3. Multiplication");
    print("\t4. Division");
    print("\t5. Quit Program");
    print();
    return int(input("\tChoose your option: "));


def add(a, b):
    print();
    print("\t",a, "+", b, "=", a + b);


def sub(a, b):
    print();
    print("\t",a, "-", b, "=", a - b);


def mul(a, b):
    print();
    print("\t",a, "*", b, "=", a * b);


def div(a, b):
    print();
    print("\t",a, "/", b, "=", a / b);


loop = 1
choice = 0
while loop == 1:
    choice = menu()
    if choice == 1:
        print();
        add(int(input("\tAdd this: ")), int(input("\tto this: ")))
    elif choice == 2:
        print();
        sub(int(input("\tSubtract this: ")), int(input("\tfrom this: ")))
    elif choice == 3:
        print();
        mul(int(input("\tMultiply this: ")), int(input("\tby this: ")))
    elif choice == 4:
        print("\n");
        div(int(input("\tDivide this: ")), int(input("\tby this: ")))
    elif choice == 5:
        loop = 0
print();
print("\tThank you for using this program.");
print();
print("\tEND OF PROGRAM");




Factorial of a Number Using Functions in Python

A very simple program to show you how to perform factorial of a given number by the user using functions in Python

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 Output

# factorial.py
# Rollyn M. Moises and Jake R. Pomperada
# February 25, 2019    Tuesday
# Bacolod City, Negros Occidental


def factorial(number):
    solve_results = 1
    for i in range(2, number + 1):
        solve_results *= i
    return solve_results


def my_program():
  print();
  print("\t@==================================@")
  print("\t      Factorial of a Number     ")
  print("\t@==================================@")
  print();
  value = int(input("\tEnter a Number : "))
  print("");
  if value < 0:
    print("\tSorry, factorial does not exist for negative numbers")
  elif value == 0:
    print("\tThe factorial of 0 is 1")
  else:
    print("\tThe factorial of",value,"is",factorial(value))
  print();
  repeat = input('\tDo you want to continue ? (Y/N) : ')
  if repeat.upper() == "N":
      print()
      print("\tThank You For Using This Program.")
      print();
      print("\tEND OF PROGRAM");
      quit

  if repeat.upper() == "Y":
      my_program()

if __name__ == '__main__':
    my_program()