Saturday, June 26, 2021

Body Mass Index in Python

Body Mass Index in Python

 
A simple program  that I wrote to compute the body mass index 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

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

print("===========================")
print(" Body Mass Index in Python ")
print("===========================")
print()

hf = float(input("Enter your height in feet: "))
hi = float(input("Enter your height in inches: "))

wkg = float(input("Enter you weight in kilograms: "))
hm = ((hf*30.48)+(hi*2.54))/100
bmi = wkg/(hm*hm)

print()
print("Your Body Mass Index is %.2f" %(bmi))
print()
print("End of Program")

Simple Payroll in Python

Simple Payroll in Python

 I wrote this simple payroll program using Python programming language I hope you will like it.

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.py
# Author : Jake Rodriguez Pomperada, MAED-IT, MIT
# Python
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental

print("===========================")
print(" Simple Payroll in Python ")
print("===========================")
print()
name = str(input("Enter Employee Name: "))
hr = int(input("Enter hours rendered: "))
rate = int(input("Enter rate per hour: "))
gsis = int(input("GSIS Premium: "))
ph = int(input("PhilHealth: "))
loan = int(input("Housing Loan: "))
tax = int(input("Tax Rate: "))

gross = hr*rate
deduc = gsis+ph+loan+(gross*(tax/100))
net = gross - deduc

print("===========================")
print("Gross Salary is %.2f" %(gross))
print("Total Deduction is %.2f" %(deduc))
print("Net Salary is %.2f" %(net))

Friday, June 25, 2021

Gender Checker in Modern C++

 Machine Problem in C++

Write a program that will ask the user to input a character “m” or “f” and  then it will display “Hello Sir. You are a Male ”  if the input is “f” otherwise “Hello Madam. You are a Female”. Use if-else statement.

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

gender.cpp

// gender.cpp

// Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

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

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental

// June 24, 2021  Thursday  9:41 PM


#include <iostream>


int main(int argc, char **argv)

{

    char gender;

    std::cout <<"\tGender Checker in Modern C++";

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

    std::cout << "Enter the gender(m or f): ";

    std::cin >> gender;

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

    if (gender == 'm' || gender == 'M')

        std::cout << "Hello Sir. You are a Male.\n";

    else if (gender == 'f' || gender == 'F')

        std::cout << "Hello Madam. You are a Female.";

    else

        std::cout << "Invalid input.\n";

}


Wednesday, June 23, 2021

Bakit Sikat ang Python Programming Language Dito sa Philippines

Salary Computation in Python

Salary Computation in Python

 Machine Problem Using Module in Python


1. Create a Salary Computation App

2. Create 3 Modules for this app

3. The first module is GrossSalary.py will handle the function 

   for computing the gross salary.

4. The second module is SalaryDeductions.py will handle the function 

   for computing the deductions

5. The last module NetSalary.py will be responsible for computing the net salary.

6. The user will input the following (Name, Hour, Loan, Health Insurance).

7. Tax(12% of the gross salary) and Rate(500/hr) is fixed

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

GrossSalary.py

from SalaryDeductions import tax, rate, TotalDeductions
from NetSalary import net

name = str(input("Enter Name: "))
hour = int(input("Hour: "))
gross = rate(hour)

print()
print("Gross Salary:", gross)

print()
print("Tax:", tax(gross))
loan = float(input("Loan: "))
insurance = float(input("Insurance: "))
deductions = TotalDeductions(tax(gross), insurance, loan)
print()

print("Total Deduction: ", deductions)
print()
print("Net Salary: ", net(gross, deductions))

NetSalary.py
def net(gross, deductions):
return gross - deductions

SalaryDeductions.py
def tax(gross):
return gross * 0.12


def rate(hour):
return 500 * hour


def TotalDeductions(tax2, insurance, loan):
return tax2 + insurance + loan



Random Name Generator Using Python

 


Machine Problem 


Random Module in Python

1. Create a  Random Name Generator App 

2. Create 3 lists for first name, middle name, and last name with 10 items per list 

3. The application will ask the user to generate a new name.

4. If yes, use a random number between 0 - 9 to randomly select items in the lists 

5. Display the generated name “Congratulations! 

Your new name is ________ 

6. If No, display the word “Thank you! ” and display all the names that user generated.

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 random

first = ["Kai", "Hunter", "Luca", "Quinn", "River", "Skylar", "Hayden", "Riley", "Reese", "Jude"]
middle = ["Abbot", "Griffith", "Maxfield", "Rufus", "Eva", "Emma", "Olivia", "Sims", "Tan", "Ovilda"]
last = ["James", "Doha", "Harden", "Jordan", "Bryant", "Williams", "Simmons", "Imbid", "George", "Leonard"]
namebank = []
while True:
name = input("Do you want to generate a new name? [y/n]: ")
if name.upper() == "Y":
rand = random.randint(0, 4)
randname = first[rand] + " " + middle[rand] + " " + last[rand]
namebank.append(randname)
print(f"Your new name is {randname}\n")
continue
elif name.upper() == "N":
print("Thank you!")
print("List of generated names:")
for x in namebank:
print(f"{x}")
break


Tuesday, June 22, 2021

replace noun and adjectives in a Poem in Python

Replace Noun and Adjectives in a Poem in Python

 A simple program which allows the user to replace nouns and adjectives in a Poem in 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

# Replace Noun and Adjectives in a Poem
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental

noun1 = str(input("Input the first noun: "))
noun2 = str(input("Input the second noun: "))
adj1 = str(input("Input the first adjective: "))
adj2 = str(input("Input the second adjective: "))

poem = "Up there on the mountain road, the fireworks blistered and subsided."
reps = "Up there on the {} {}, the fireworks {} and {}."
reps = reps.format(noun1.upper(), noun2.upper(), adj1.upper(), adj2.upper())
print("Original poem: ", poem)
print("Result: ", reps)

Monday, June 21, 2021

Overall Average Grade Solver in C++

Overall Average Grade Solver in C++

 A simple overall average grade solver that I wrote using C++ programming language. I am using codeblocks to run my 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 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

#include <iostream>

#include <iomanip>

#include <cmath>

#include <string>


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


std::string 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()

{

constexpr int num_grades = 5;

int num_students = 0, student, grade;

double sum , total_sum = 0.0;


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 << "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";

}


Saturday, June 19, 2021

Reverse a String Using a Function in Python

 Machine Problem in Python


1. Write a Python program to reverse a string

2. The user will input a word

3. Create a function that will reverse the string.

4. Display the original word, the reversed word in all caps and string count.

Sample Program Output

INPUT: Hello World

OUTPUT: DLROW OLLEH (11 characters)


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

reverse_string.py

def reverse_string(word):
return word[::-1]

string = input("Enter a string: ")
print(string)
print(reverse_string(string.upper()))
print("String count: ", len(string))



Student Average Using Functions in Python

 Machine Problem in Python

1. Write a program that computes students average

2. Use a function with 4 parameters (Name, Math, English and Science Grade)

3. Reference the function 3 times with different values

Sample Program Output

John’s grade (Math=?, Science=?, English=?) and the average is ?

Ana’s grade (Math=?, Science=?, English=?) and the average is ?

Frank’s grade (Math=?, Science=?, English=?) and the average is ?


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

average_function.py


def Average(Name,Math,English,Science):
solve = int(Math+English+Science)/3
print("{0}'s grade (Math={1}, Science={2},English={3}),and the average is {4}."
.format(Name,Math,English,Science,round(solve)))

print()
Average("John",85,91,77)
print()
Average("Ana",83,89,93)
print()
Average("Frank",93,76,89)


Word Bank in Python

Word Bank in Python

 Machine Problem in Python

1. Write a word bank program

2. The program will ask to enter a word

3. The program will store the word in a list

4. The program will ask if the user wants to try again. The user will input

Y/y if Yes and N/n if No

5. If Yes, refer to step 2.

6. If No, Display the total number of words and all the words that user

entered.

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

res = "y"
wordbank = list()
while res.lower() == "y":
word = str(input("Enter a word: "))
wordbank.append(word)
res = str(input("Do you want to try again? (Y/N)"))
print("=======")
print(f"Total Number of Words: {len(wordbank)}")
print("Word in the list:")
for w in wordbank:
print(w)


Loan Calculator in PHP

 I wrote this simple loan calculator to solve the loan of the customer using PHP 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.php


<!doctype html>

<html>

<head>

<title>Loan Calculator in PHP</title>

</head>

<body>

<form method="POST" action="">

<h2>Loan Calculator in PHP</h2>

<?php

$amount=$interest_rate=$period=NULL;

$total_interest=$total_payable=$monthly_payable=0;

if(isset($_POST['compute'])){

$amount=$_POST['amount'];

$interest_rate=$_POST['interest_rate'];

$period=$_POST['period'];

$total_interest=$amount*($interest_rate/100)*$period;

$total_payable=$total_interest+$amount;

$monthly_payable=$total_payable/$period;

}

?>

<p>Amount Needed: <input type="text" name="amount" size="8" value="<?=$amount;?>"/></p>

<p>Interest Rate: <input type="text" name="interest_rate" size="8" value="<?=$interest_rate;?>"/></p>

<p>Payment Period: <input type="text" name="period" size="8" value="<?=$period;?>"/></p>

<p><input type="submit" name="compute" value="Compute"/></p>

<p>

Loan Amount: <?=number_format($amount, 2);?><br/>

Total Interest: <?=number_format($total_interest, 2);?><br/>

Total Payable: <?=number_format($total_payable, 2);?><br/>

Monthly Payable: <?=number_format($monthly_payable, 2);?>

</p>

</form>

</body>

</html> 


Thursday, June 17, 2021

Display Message 20 Times Using Python

Display Message 20 Times in Python

Display Message 20 Times in Python

Machine Problem Using While Loop in Python

1. Write a program that will loop the message 20 times. Use while loop

only.

Python while loop number 1

Python while loop number 2

...

Python while loop number 20

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

i = 1

while i <= 20:
print("Python while loop number", i)
i += 1