Wednesday, June 30, 2021

Multiplication Table in Python

Multiplication Table in Python

 A simple multiplication table that I wrote using Python programming language 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 at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.





Program Listing

# Multiplication_Table.py
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental

a = 1
print("-" * 60)
print("\t\t\t\tMULTIPLICATION TABLE ")
print("-" * 60)
while a < 13:
n = 1
while n <= 12:
print("%4d" % (a * n), end=' ')
n += 1
print()
a += 1
print("-" * 60)

Simple Interest Rate Solve in JavaScript

Simple Interest Calculator in JavaScript

 A simple interest calculator in JavaScript I wrote a long time ago while teaching JavaScript programming in one of the colleges here in the Philippines.

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 at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Program Listing

index.htm

<html>
<style>
body,p {

  font-family:arial;
  font-size:16px;
  font-weight:bolder;
 }
 
    .container {
        width: 450px;
        clear: both;
    }
    .container input {
        width: 100%;
        clear: both;
    }

    </style>
<div class="container">
<body>
<h3> Simple Interest Calculator in JavaScript </h3>
<br/>Principal (P): Php
<input type="text" id="principal" name="principal">
<br>
<br/> Rate (R):
<input type="text" id="rate" name="rate">
<br>
<br/> Time (t):
<input type="text" id="time" name="time">
<br>
<br>
<button onclick="compute_interest()">Compute Interest</button>
<br><br>
<p id="demo"></p>

</div>
<script>
function Commas(n) {
    var parts=n.toString().split(".")
    return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + (parts[1] ? "." + parts[1] : "");
}
  function compute_interest() {
    var  principal = document.getElementById("principal").value;
var  rate = document.getElementById("rate").value;
var  time = document.getElementById("time").value;
     rate2 = parseFloat(rate)/100;
amount_interest = parseFloat(principal) * (1+ (parseFloat(rate2)*time));
     
amt =amount_interest.toFixed(2);
display = Commas(amt);
results ="Amount to be paid is Php " + display+".";
     
      document.getElementById("demo").innerHTML = results;
  }
</script>
</body>
</html>


Multiplication Table in JavaScript

Multiplication Table in JavaScript

 A simple program to generate multiplication table using JavaScript 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 at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.





Program Listing

index.htm

<html>

<head>

<title>MULTIPLICATION TABLE </title>

</head>

<style>

body {

  font-family:arial;

  font-size:20px;

  }

 </style>  

<body>

<br>

<h3 align="center"> MULTIPLICATION TABLE</h3>

<script language="JavaScript">


document.write("<center><table border='1px'>");


for(var a = 1; a < 13; a++) {

    document.write("<tr style='height:40px'>");


for(var b = 1; b < 13; b++) {

    document.write("<td style='width:40px'><center><font size='4'>" 

+ a*b + "</center></font></td>");

}

document.write("</tr>");

}

document.write("</table></center>");


</script>

</head>

</body>

</html>

 

 

Tuesday, June 29, 2021

Grade Solver in PHP

Grade Solver in PHP

 I simple grade solver using PHP programming language to solve the grade the average of the students.

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 at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.






Program Listing

index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Grade Solver in PHP</title>

</head>

<style type="text/css">

  body {

    font-family: arial;

    size:14px;

  };

</style>

<body>

  <h3>Grade Solver in PHP </h3>

  <p> Created By Prof. Jake Rodriguez Pomperada, MAED-IT, MIT </p>

<form action="grade_result.php" method="post">

<table width="301" border="1">

  <tr>

    <td width="141">Enter Prelim:</td>

    <td width="144"><label>

      <input type="text" name="txtpre" id="textfield" />

    </label></td>

  </tr>

  <tr>

    <td>Enter Midterm:</td>

    <td><label>

      <input type="text" name="txtmid" id="textfield2" />

    </label></td>

  </tr>

  <tr>

    <td>Enter Semifinal:</td>

    <td><label>

      <input type="text" name="txtsem" id="textfield3" />

    </label></td>

  </tr>

  <tr>

    <td>Enter Final:</td>

    <td><label>

      <input type="text" name="txtfin" id="textfield4" />

    </label></td>

  </tr>

  <tr>

    <td><label>

      <input type="submit" name="submit" id="button" value="Compute" />

    </label></td>

    <td><label>

      <input type="reset" name="clear" id="button2" value="Clear" />

    </label></td>

  </tr>

</table>

<p>&nbsp;</p>

</form>

</body>

</html>


grade_result.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Grade Solver</title>
</head>

<body>
  <style type="text/css">
  body {
    font-family: arial;
    size:14px;
  };
</style>
<?php
error_reporting(0);
$pre = $_POST['txtpre'];
$mid = $_POST['txtpre']; 
$sem = $_POST['txtsem'];
$fin = $_POST['txtfin'];

$avg=($pre + $mid + $sem + $fin)/4;

if ($avg <=75)
{
$remarks="POOR";
}
else if ($avg<=80)
{
$remarks="Needs Improvements";
}
else if ($avg<=85)
{
$remarks="GOOD";
}
else if ($avg<=90)
{
$remarks="Excellent";
}
else 
{
$remarks="Outstanding";
}
?>

<h3>Grade Results </h3>
<table width="348" border="1">
  <tr>
    <td width="174">Prelim Grade:</td>
    <td width="158"><?php echo $pre; ?></td>
  </tr>
  <tr>
    <td>Midterm Grade:</td>
    <td><?php echo $mid; ?></td>
  </tr>
  <tr>
    <td>Semi-Final Grade:</td>
    <td><?php echo $sem; ?></td>
  </tr>
  <tr>
    <td>Final Grade:</td>
    <td><?php echo $fin; ?></td>
  </tr>
  <tr>
    <td>Your Average is:</td>
    <td><?php echo $avg; ?></td>
  </tr>
  <tr>
    <td>Your Remarks is:</td>
    <td><?php echo $remarks; ?></td>
  </tr>
</table>
</body>
</html>

Monday, June 28, 2021

Student Grading System in C++ Using OOP Approach

Student Grading System in C++ Using OOP Approach

 A simple student grading system in C++ using Object Oriented Approach 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 at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.





Program Listing

// Grading_System.cpp

// Jake Rodriguez Pompeada, MAED-IT, MIT

// www.jakerpomperada.com and www.jakerpomperada.blogspot.com

// jakerpomperada@gmail.com


#include <iostream>

#include <iomanip>

#include <cmath>

#include <string>


#define EXIT_IF(cnd, msg) if(cnd){std::cerr << msg; exit(1);}


class Grader

{

public:

void run();

private:

std::string get_performance(double grade);

};


void Grader::run()

{

constexpr int num_grades = 5;

int num_students = 0, student, grade;

double sum, total_sum = 0.0;


    std::cout << "\n\n";

std::cout << "\tStudent Grading System in C++ Using OOP Approach";

std::cout << "\n\n";

std::cout << "Number of students in the class? ";

std::cin >> num_students;

std::cin.ignore(255, '\n');

EXIT_IF(num_students < 0, "Invalid Input: Please enter a nonnegative integer.");

for (student = 0; student < num_students; ++student)

{

sum = 0.0;

for (grade = 0; grade < num_grades; ++grade)

{

std::cout << "Grade of Student #" << student + 1 << " in Subject " << grade + 1 << ": ";

int tmp;

std::cin >> tmp;

EXIT_IF(tmp < 0, "Invalid Input: Please enter a nonnegative integer.");

sum += tmp;

}

double avg = std::round(sum / num_grades);

std::cout << "\n\n";

std::cout << "Average of Student " << student + 1 << " is : " << avg << "\n";

total_sum += avg;

}

double class_average = total_sum / num_students;

std::cout << std::fixed << std::setprecision(2) <<

"Class Average Grade is : " << class_average << "\n";

std::cout << "Class Performance is " << get_performance(class_average) << "\n";

}


std::string Grader::get_performance(double grade)

{

if (grade < 70)

return "Poor";

else if(grade <= 74)

return "For Improvement";

else if (grade <= 80)

return "Good";

else if (grade <= 90)

return "Very good";

else

return "Excellent";

}


int main()

{

Grader grader;


grader.run();

}



Sunday, June 27, 2021

Simple Payroll Program in C

SIMPLE PAYROLL PROGRAM IN C

 

Machine Problem in C

Write and design a payroll program that will ask the user how many days an employee work in the company and then the salary rate per day. In addition, the program also will ask the user the SSS, PAG-IBIG, BIR and PHILHEALTH contributions. The payroll program will compute the gross salary, total deductions, and net salary and display the result 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 at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.








Program Listing

/* simple_payroll_program_in_c.c

   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT, MIT

   Date     : June 27, 2021  9:49 AM  Sunday

   Location : Bacolod City, Negros Occidental

   Tool     : Codeblocks

   Website  : http://www.jakerpomperada.com and http://www.jakerpomperada.blogpsot.com

   Email    : jakerpomperada@gmail.com */


#include <stdio.h>


int main()

{

   float days=0,rate=0.00,solve_gross=0.00;

   float sss=0.00,pag_ibig=0.00,bir=0.00;

   float philhealth=0.00,solve_net_salary=0.00;

   float total_deductions=0.00;


   system("COLOR F0");

   printf("\n\n");

   printf("\tSIMPLE PAYROLL PROGRAM IN C");

   printf("\n\n");

   printf("\tHow Many Days Work : ");

   scanf("%f",&days);

   printf("\n");

   printf("\tSalary Per Day     : PHP ");

   scanf("%f",&rate);

   printf("\n\n");


   /* Solving Gross Salary Here */


   solve_gross = (days * rate);


   printf("\tGross Salary            : PHP %.2f ",solve_gross);

   printf("\n\n");

   printf("\tSSS Contribution        : PHP ");

   scanf("%f", &sss);

   printf("\tPAG-IBIG Contribution   : PHP ");

   scanf("%f",&pag_ibig);

   printf("\tBIR Contribution        : PHP ");

   scanf("%f",&bir);

   printf("\tPHILHEALTH Contribution : PHP ");

   scanf("%f",&philhealth);


    /* Solving Total Deductions and Net Salary Here */


    total_deductions = (sss+pag_ibig+bir+philhealth);

    solve_net_salary = (solve_gross - total_deductions);


    printf("\n\n");

    printf("\tDisplay Payroll Results");

    printf("\n\n");

    printf("\tGross Salary     : PHP %.2f\n",solve_gross);

    printf("\tTotal Deductions : PHP %.2f\n",total_deductions);

    printf("\n\n");

    printf("\tNet Salary       : PHP %.2f",solve_net_salary);

  printf("\n\n\n");

    printf("\tEND OF PROGRAM");

    printf("\n\n");

    }


Restaurant Reservation System in Python

Restaurant Reservation System in Python

Write and develop a small restaurant reservation program. The application offers different reservation rate for adults and children using Python 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 at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.









Program Listing

import os import sys from pathlib import Path


class menu:
def __init__(self, choice):
self.choice = choice
if choice == "A":
count = 0
file = open("reservation.txt")
lines = file.readlines()[1:]
file.close()
for line in lines:
count += 1

if count == 0:
print("There are no reservations!!")
print()
else:
file = open("reservation.txt", "r")
print(file.read())
file.close()

elif choice == "B":
with open("reservation.txt", "r") as file:
for last_line in file:
pass

if last_line[0] == "#":
num = 1
else:
num = int(last_line[0]) + 1

name = input("Enter Name: ")
date = input("Enter Date: ")
time = input("Enter Time: ")
adults = int(input("No. of Adults: "))
children = int(input("No. of Children: "))
file = open("reservation.txt", "a")
file.write(f"{num}\t\t\t{name}\t\t\t{date}\t\t\t{time}\t\t\t{adults}\t\t\t{children}\n")
file.close()
print()

elif choice == "C":
resnum = input("Enter Reservation number: ")
file1 = open("reservation.txt", "r")
lines = file1.readlines()
file1.close()
file2 = open("reservation.txt", "w")

for line in lines:
if not line.startswith(resnum):
file2.write(line)
file2.close()

elif choice == "D":
adults, children, total_adults, total_children, total = 0, 0, 0, 0, 0
file = open("reservation.txt", "r")
list_of_lists=[]
report = ""
i = 0

for line in file:
i += 1
if i > 1:

stripped_line = line.strip()
line_list = stripped_line.split("\t\t\t")
adults += int(line_list[4])
children += int(line_list[5])
subtotal = (int(line_list[4]) * 500) + (int(line_list[5]) * 300)
total += subtotal
line_list.append(str(subtotal))
report += f"{line_list[0]}\t\t\t{line_list[2]}\t\t\t{line_list[3]}\t\t\t" \
f"{line_list[1]}\t\t\t{line_list[4]}\t\t\t{line_list[5]}\t\t\t{line_list[6]}\n"
file.close()

print()
print()
print(" REPORT")
print()
print("#\t\t\tDate\t\t\t\tTime\t\t\t\tName\t\t\t\tAdults\t\t\tChildren\t\tSubtotal")
print(report)
print("Total Number of Adults: ", adults)
print("Total Number of Children: ", children)
print("Grand Total: PHP ", total)
print("---------------------------------------------------------------- nothing follows "
"----------------------------------------------------------------")
print()
print()

elif choice == "E":
import sys
sys.exit("Thank you!")

else:
print("Invalid response. Please try again.")


while True:
try:
file = open("reservation.txt", "r")
except FileNotFoundError:
file = open("reservation.txt", "w+")
file.write("#\t\t\tName\t\t\t Date\t\t\t Time\t\t\t Adults\t\t\tChildren\n")
file.close()

print("RESTAURANT RESERVATION SYSTEM")
print("System Menu:")
print("A. View all Reservations\tB. Make Reservation")
print("C. Delete Reservation\t\tD. Generate Report")
print("E. Exit\n")

selection_menu = input('Enter selection: ').upper()
menu(selection_menu)