Thursday, December 3, 2020

Payroll Program in Java Using Method Overloading

 Machine Problem in Java


Payroll that includes five double field variables that hold hours

worked, rate of pay per hour, withholding rate, gross pay, and net pay, and three String

field variables that holds the last name, first name and position of the employee. 


Create three overloaded computeNetPay() methods. 


When computeNetPay() receives values 

for hours, pay rate, and withholding rate, it computes the gross pay and reduces it by

the appropriate withholding amount to produce the net pay. 


When computeNetPay() 

receives two arguments, they represent the hours and pay rate, and the withholding

rate is assumed to be 10%. 


When computeNetPay() receives one argument, it

represents the number of hours worked, the withholding rate is assumed to be 10%,

and the hourly rate is assumed to be 59.65. 


Name the program as Payroll.java

The gross pay is computed as hours worked multiplied by pay per hour.

Display the last name, first name, position, total pay for the hour's work, withholding

rate, gross pay and the net pay of the employee.

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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.



Program Listing

Payroll.java


// Payroll.java

// Author : Mr. Jake Rodriguez  Pomperada, MAED-IT, MIT

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

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental,Philippines

// December 3, 2020   Thursday


import java.text.DecimalFormat;


public class Payroll {

private static DecimalFormat df2 = new DecimalFormat("#.##");

public  void EmployeesRecord(String LastName, String FirstName, String Position )

{

System.out.println("\n");

System.out.println("\tEMPLOYEE'S INFORMATION");

System.out.println();

System.out.println("\tEmployee's LastName  : " + LastName );

System.out.println("\tEmployee's FirstName : " + FirstName );

System.out.println("\tEmployee's Postion   : " + Position );

System.out.println();

}

// Method Overloading computeNetPay() No. 1 

public void computeNetPay(double hoursWork, double pay_rate,double withholding_rate)

{

double gross_pay=0.00;

double solve_netpay=0.00;

double tax=0.00;

double solve_percentage=0.00;

solve_percentage = (withholding_rate/100);

gross_pay = (hoursWork* pay_rate);

tax = (gross_pay * solve_percentage);

solve_netpay = (gross_pay - tax);

   System.out.println("\tThe Net Pay is PHP "+ df2.format(solve_netpay));

}


// Method Overloading computeNetPay() No. 2 

public  void computeNetPay(double hoursWork, double pay_rate)

{

double gross_pay;

double solve_netpay;

double tax;

double withholding_rate = 0.10;

gross_pay = (hoursWork* pay_rate);

tax = (gross_pay * withholding_rate);

solve_netpay = (gross_pay - tax);

   System.out.println("\tThe Net Pay PHP "+ df2.format(solve_netpay));

}


// Method Overloading computeNetPay() No. 3 

public  void computeNetPay(double hoursWork)

{

double gross_pay;

double solve_netpay;

double tax;

double pay_rate = 59.65;

double withholding_rate = 0.10;

gross_pay = (hoursWork* pay_rate);

tax = (gross_pay * withholding_rate);

solve_netpay = (gross_pay - tax);

   System.out.println("\tThe Net Pay PHP "+ df2.format(solve_netpay));

}


public static void main(String[] args) {

// TODO Auto-generated method stub

    Payroll employee1=new Payroll();

    

    Payroll employee2=new Payroll();

    

    Payroll employee3=new Payroll();

        

    System.out.println("\n");

System.out.print("\tPayroll Program in Java Using Method Overloading");

// Method Overloading computeNetPay() No. 1  

employee1.EmployeesRecord("Pomperada","Jake", "Jave Developer");

employee1.computeNetPay(15,250.60,12);


// Method Overloading computeNetPay() No. 2  

employee2.EmployeesRecord("Pomperada","Allie", "Chemical Engineer");

employee2.computeNetPay(40,485.71);

// Method Overloading computeNetPay() No. 3  

employee3.EmployeesRecord("Pomperada","Jacob Samuel", "Software Architect");

employee3.computeNetPay(35);

System.out.println("\n");

System.out.print("\tEnd of Program");

System.out.println("\n");

}


}



Addition of Three Numbers in Ruby

Addition of Three Numbers in Ruby

 I wrote this program to ask the user to give three integer numbers and then the program will compute its sum and display the results using Ruby 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.




Program Listing

addition.rb

# addition.rb
# Author   : Jake Rodriguez Pomperada,MAED-IT, MIT
# Date     : December 3, 2020  
# Address  : Bacolod City, Negros Occidental
# Tools    : Eclipse IDE and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental  
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com
puts "\n\n"
print "\tAddition of Three Numbers in Ruby";
puts "\n\n"
print "\tGive First Value  : ";
val1 = gets;
print "\tGive Second Value : ";
val2 = gets;
print "\tGive Third Value  : ";
val3 = gets;

val1 = val1.to_i;
val2 = val2.to_i;
val3 =  val3.to_i;
sum = sum.to_i;

sum = (val1+val2+val3);
print "\n";
print "\tThe sum of ",val1,",",val2," and ",val3," is ",sum,".";
puts "\n\n"
print "\tEnd of Program";
puts "\n"


Wednesday, December 2, 2020

How to Use String and Integer Variables in C++

How to Use String and Integer Variables in C++

 In this tutorial I will show you how to use string and integer variables in C++ 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.



Program Listing

#include <iostream>



using namespace std;


int main() {


string student_name;

    string school;

string course_year_section;

int age=0;




std::cout << "Name : ";

    getline(cin,student_name);

std::cout << "Age  : ";

cin >> age;

cin.ignore();

std::cout << "School : ";

    getline(cin,school);

    std::cout << "Course, Year and Section : ";

    getline(cin,course_year_section);

    

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

std::cout << "\tDISPLAY RESULTS";

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

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

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

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

std::cout << "Course, Year and Section  :"

<< course_year_section <<"\n";

}




Qualified To Vote in C

Qualified To Vote in C

 Machine Problem

Write a program using C language that determines if the input age is qualified to vote or not.  The qualifying age is 18 years old and above. 

 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing


/* vote.c

   Mr. Jake Rodriguez Pomperada,MAED-IT, MIT

   www.jakerpomperada.com, www.jakerpomperada.blogspot.com

   jakerpomperada@gmail.com

   Bacolod City, Negros Occidental Philippines


Machine Problem


Write a program using C language that determines 

if the input age is qualified to vote or not. 

The qualifying age is 18 years old and above. 


*/



#include <stdio.h>


int main() {


int age=0;


printf("\n\n");

printf("\tQualified To Vote in C");

printf("\n\n");

printf("\tGive Your Age : ");

scanf("%d",&age);

printf("\n\n");

if(age>=18) {

printf("\tAt the age of %d  years old.\n\n",age);

printf("\tYou are qualified to vote.");

} else {

printf("\tAt the age of %d  years old.\n\n",age);

printf("\tYou too young to vote.");

}

  printf("\n\n");

  printf("\tEnd of Program");

  printf("\n\n");

}

Arithmetic Operators in C

Arithmetic Operators in C

 Machine Problem in C

The sum of the first and second number, then the difference of the sum(total first and second number) and the third number product of the difference( sum and third) and the Fourth. The quotient of the product(difference and fourth) and the fifth number.

 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.



Program Listing

/* Machine Problem in C


The sum of first and second number, 

then the difference of the sum(total first and second number) and 

the third number product of the difference( sum and third) and

the Fourth. The quotient of the product(difference and fourth)

and the fifth number.


arithmetic.c


Mr. Jake Rodriguez Pomperada,MAED-IT, MIT

www.jakerpomperada.com, www.jakerpomperada.blogspot.com

jakerpomperada@gmail.com

December 2, 2020   Wednesday

Bacolod City, Negros Occidental Philippines


*/


#include <stdio.h>



int main()

{

float first=0,second=0;

float third=0,fourth=0;

float fifth=0;

float sum=0,difference=0;

float product=0, quotient=0;

float sum_all = 0;

printf("\n\n");

printf("\tArithmetic Operators in C");

printf("\n\n");

sum = (first+second);

difference = (first-second);

first = 100; second = 10;


sum = first + second;

third = 5;


difference = sum - third;

printf("\tThe sum of %5.2f and %5.2f is %5.2f.",first,second,sum);

printf("\n\n");

printf("\tThe difference between %5.2f and %5.2f is %5.2f."

      ,first,second,difference);

 

    fourth = 2;

product  = difference * fourth;

printf("\n\n");      

printf("\tThe product of %5.2f and %5.2f is %5.2f."

,difference,fourth,product);

fifth = 20;

quotient =  (product / fifth);

printf("\n\n");      

printf("\tThe quotient of %5.2f and %5.2f is %5.2f."

,product,fifth,quotient);

printf("\n\n");  

printf("\tEnd of Program");  

printf("\n\n");  

}


Tuesday, December 1, 2020

Bubble Sort in Descending Order in C++

BUBBLE SORT IN DECENDING ORDER

 I will show you how to write a program that will ask the user to give a series of numbers and then the program will sort the given number using a bubble sort algorithm in descending order in C++ 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 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.



Program Listing

// bubble_sort.cpp

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

// Dev C++

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

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental Philippines


#include <cstdlib>

#include <iostream>


using namespace std;


int compare(int, int);

void sort(int[], const int);

void swap(int *, int *);


int compare(int x, int y)

     return(x < y);

}


void swap(int *x, int *y)

{

     int temp;

     temp = *x;

     *x = *y;

     *y = temp;

}


void sort(int table[], const int n)

{

     for(int i = 0; i < n; i++)

     {

          for(int j = 0; j < n-1; j++)

          {

               if(compare(table[j], table[j+1]))

                    swap(&table[j], &table[j+1]);

          }

     }

}


int quantity;

int* tab;


int main(int argc, char *argv[])

{

    cout << "\n\n"; 

cout << "\t\t\tBUBBLE SORT IN DECENDING ORDER\n";

    cout << "\n\t\t Created By: Mr. Jake R. Pomperada, MAED-IT, MIT";

    cout << "\n\n";   

    cout << "\tHow Many Items :=> ";

cin >> quantity;

tab = new int [quantity];

cout << "\n\n";   

for (int i = 0; i < quantity; i++)

{

    int x = i;

    cout << "\tGive value in item no. " << ++x << ": ";

    cin >> tab[i];

}


cout << "\n\tBefore Sorting: ";

cout << "\n\n";

cout << "\t";

for (int i = 0; i < quantity; i++)

{

     cout << tab[i] << " ";

}


cout << "\n\n";

cout << "\tAfter Sorting: \n";

sort(tab, quantity);

cout << "\n\n";

cout <<"\t";

for(int i = 0; i < quantity; i++)

{

     cout << tab[i] << " ";

}

 cout << "\n\n";

    system("PAUSE");

    return EXIT_SUCCESS;

}


Employees Payroll System in C++

Employee's Payroll System in C++

 An Employee's Payroll System that I wrote using a C++ programming language to solve the salary of the employees in the company.

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 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 I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.




Program Listing

// payroll.cpp

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

// Dev C++ 

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

// jakerpomperada@gmail.com

// Bacolod City, Negros Occidental Philippines

// December 1, 2020    Tuesday


#include <iostream>

#include <string>

#include <iomanip>


using namespace std;


struct employee {

    string name, department;

    int age;

    char gender;

    float days, rate;

};


main() {


    float solve=0.00;

    string sex;

    employee user;


     cout << "\t\tEmployee's Payroll System in C++";

     cout << "\n\n";

     cout << "\t Created By: Mr. Jake R. Pomperada,MAED-IT, MIT";

     cout << "\n\n";

     cout << "Enter the Name of the Employee    : ";

     getline(cin,user.name);

     cout << "Enter the Name of Department      : ";

     getline(cin,user.department);

     cout << "Enter the Gender of the Employee  : ";

     user.gender = getchar();

     cout << "Enter the Number of Days Worked   :  ";

     cin >> user.days;

     cout << "Enter the Daily Rate              :  ";

     cin >> user.rate;


     solve = (user.days * user.rate);

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

        {

          sex = "Male";

        }

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

        {

          sex = "Female";

        }

    cout << fixed;

    cout << setprecision(2);

     cout << "\n\n";

     cout << "\t ===== GENERATED REPORT =====";

     cout << "\n\n";

     cout << "\nEmployee Name : " << user.name;

     cout << "\nDeparment     : " << user.department;

     cout << "\nGender        : " << sex;

     cout << "\nSalary        : $" << solve;

     cout << "\n\n";

     system("pause");

}