Sunday, January 31, 2021

Paycheck Calculator in JavaScript

Paycheck Calculator in JavaScript

 Machine Problem in JavaScript

The Paycheck assignment requires that we create an application that calculates paycheck information.

The user inputs First Name, Last Name, Regular Hours worked, Overtime Hours worked, Hourly PayRate, FICA, State, and Federal Tax Rates. The application calculates and displays the Regular Pay, Overtime Pay, Gross Pay, Total Taxes, and Net Pay. 

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

paycheck.html

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<title>Paycheck Calculator in JavaScript</title></title>

<link rel="stylesheet" href="css/styles.css">

</head>

<body>

<h2>Paycheck Calculator in JavaScript</h2>

<form action="javascript:void(0)" method="post" onsubmit="calculate()">

        <fieldset>

<p>Use this form to calculate the Regular Pay, Overtime Pay, Gross Pay, and Net Pay for an employee.</p>

<div><label for="firstName">First Name</label><input type="text" name="firstName" id="firstName" required></div>

<div><label for="lastName">Last Name</label><input type="text" name="lastName" id="lastName" required></div>

<div><label for="regH">Regular Hours Worked (between 0 and 40)</label><input type="number" name="regH" id="regH" value="0" min="0" max="40" required></div>

<div><label for="overH">Overtime Hours Worked (between 0 and 40)</label><input type="number" name="overH" id="overH" value="0" min="0" max="40" required></div>

<div><label for="hourR">Hourly Rate (between 0 and 99.99)</label><input type="number" name="hourR" step=".01" id="hourR" value="0.00" min="0" max="99.99" required></div>

<div><label for="regP">Regular Pay</label><input type="number" name="regP" id="regP" step=".01" value="0.00" readonly="true"></div>

<div><label for="overP">Overtime Pay</label><input type="number" name="overP" id="overP" step=".01" value="0.00" readonly="true"></div>

<div><label for="grossP">Gross Pay</label><input type="number" name="grossP" id="grossP" step=".01" value="0.00" readonly="true"></div>

<div><label for="fica">Fica Tax Rate (ex. 5.65)</label><input type="number" name="fica" id="fica" step=".01" value="0.00" required></div>

<div><label for="state">State Tax Rate (ex. 5.75)</label><input type="number" name="state" id="state" step=".01" value="0.00" required></div>

<div><label for="fed">Federal Tax Rate (ex. 28.00)</label><input type="number" name="fed" id="fed" step=".01" value="0.00" required></div>

<div><label for="totalTax">Total Taxes</label><input type="number" name="totalTax" id="totalTax" step=".01" value="0.00" readonly="true"></div>

<div><label for="empName">Employee Name</label><input type="text" name="empName" id="empName" readonly="true"></div>

<div><label for="netP">Net Pay</label><input type="number" name="netP" id="netP" value="0.00" step=".01" readonly="true"></div>

<div><input type="submit" value="Calculate" id="submit"></div>

        </fieldset>

    </form>

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

</body>

</html>


style.css


/* From: http://www.assemblesoft.com/examples/form/simpleform.html */

* {margin:0; padding:0;}


html {

font: 90%/1.3 arial,sans-serif;

padding:1em;

background:#B9C2CC;

}

form {

background:#fff;

padding:1em;

border:1px solid #eee;

}


fieldset div {

margin:0.3em 0;

clear:both;

}


form {

margin:1em;

width:15em;

}


label {

float:none;

width:12em;

display:block;

clear:both;

}


legend {

color:#0b77b7;

font-size:1.4em;

}

legend span {

width:10em;

text-align:right;

}

input {

padding:0.15em;

width:10em;

border:1px solid #ddd;

background:#fafafa;

font:bold 1em arial, sans-serif;

display:block;

float:left;

}

input:hover, input:focus {

border-color:#c5c5c5;

background:#f6f6f6;

fieldset {

border:1px solid #ddd;

padding:0 0.5em 0.5em;

}

.date input {

background-image:url(../gfx/calendar-small.gif);

background-repeat:no-repeat;

background-position:100% 50%;

}


.date fieldset label {

float:none;

display:block;

text-align:left;

width:auto;

}

.date fieldset div {

float:left;

clear:none;

margin-right:0.2em;

}

.radio, .date {

position:relative;

}

.radio fieldset, .date fieldset {

border:none;

width:auto;

padding:1px 0 0 11em;

}

.radio legend, .date legend {

font-size:1em;

color:#000;

}

.radio legend span, .date legend span {

position:absolute;

left:0;

top:0.3em;

width:10em;

display:block;

}

.radio label, .radio input {

vertical-align:middle;

display:inline;

float:none;

width:auto;

background:none;

border:none;

}

.radio div {

float:left;

white-space:nowrap;

clear:none;

}


.email {

width:14em;

}


input.default {

color:#bbb;

}


#submit {

margin:1em;

width:69px;

height:26px;

overflow:hidden;

border:0;

display:block;

cursor:pointer !important;

}

#submit:hover {

background-position:0 -26px;

}


.error {

color: #FF1400;

}

/*

:invalid {

color:red;

}

*/

/*

input[type=checkbox], input[type=radio] { visibility: hidden; width:0; height:0; padding:0; margin:0; }

input[type=checkbox] + label, input[type=radio] + label { padding-left:18px; }

input[type=checkbox] + label{ background: url(../gfx/check_radio.png) 0 0 no-repeat; }

input[type=checkbox]:focus + label{ background-position: 0 -16px; }

input[type=checkbox] + label:hover{ background-position: 0 -32px; } 

input[type=checkbox]:checked + label{ background-position: 0 -48px; }


input[type=radio] + label{ background: url(../gfx/check_radio.png) 0 -64px no-repeat; }

input[type=radio]:focus + label{ background-position: 0 -80px; }

input[type=radio] + label:hover{ background-position: 0 -96px; } 

input[type=radio]:checked + label{ background-position: 0 -112px; }

*/


paycheck.js

function calculate() {

'use strict';

//Get all inputs from controls

var firstName = document.getElementById('firstName').value;

var lastName = document.getElementById('lastName').value;

var regH = document.getElementById('regH').value;

var overH = document.getElementById('overH').value; 

var hourR = document.getElementById('hourR').value;

var regP = document.getElementById('regP').value;

var overP = document.getElementById('overP').value;

var grossP = document.getElementById('grossP').value;

var fica = document.getElementById('fica').value;

var state = document.getElementById('state').value;

var fed = document.getElementById('fed').value;

//Append Employee Name

var empName = firstName + ' ' + lastName;


//Calculations

regP = (regH * hourR);

overP = (overH * hourR * 1.5);

grossP = (regP + overP);

var totalTax = (parseFloat(fica) + parseFloat(state) + parseFloat(fed)) / 100 * grossP;

var netP = (grossP - totalTax);


totalTax = totalTax.toFixed(2);

netP = netP.toFixed(2)

regP = regP.toFixed(2);

overP = overP.toFixed(2);

grossP = grossP.toFixed(2);;


//Send Calculations to Form Controls

document.getElementById('regP').value = regP;

document.getElementById('overP').value = overP;

document.getElementById('grossP').value = grossP;

document.getElementById('totalTax').value = totalTax;

document.getElementById('empName').value = empName;

document.getElementById('netP').value = netP;

}


function init() {

'use strict';

var theForm = document.getElementById('theForm');

}

window.onload = init;



The Secret History of Windows Bluescreens by Davepl

Friday, January 29, 2021

Introduction to Progressive Web Applications

4th ICRAET

ATM in Modern C++

BACOLOD COMMERCIAL BANK ATM MACHINE IN C++

 Machine Problem in C++

 Write an ATM program using the Modern C++ approach in 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 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


// atm.cpp

// Machine Problem in C++

// Write an ATM program using Modern C++ approach in programming

// 

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

//  Dev C++ 5.11

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

//  jakerpomperada@gmail.com

//  Bacolod City, Negros Occidental Philippines


#include <iostream> 

#include <string>


  int amount=0,amt=0,a=0,balance=0;

  int option=0;

  char choice;

  std::string name, loop;

    

  

 

  void DisplayMenu();

 

  

   int main () {

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

std::cout <<"\tBACOLOD COMMERCIAL BANK ATM MACHINE";

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

std::cout << "\tEnter Your Account Name: ";

std::getline(std::cin,name);

int pinNumber = 0;

std::cout << "\tEnter Pin Number Account: ";

std::cin>>pinNumber;

system ("CLS");  

do { 

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

std::cout << "\tBANK ACCOUNT DETAILS";

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

    std::cout << "\t1. Account Name: " << name <<std::endl;

std::cout << "\t2. Account Balance: " << "PHP " << balance << std::endl <<std:: endl; 

DisplayMenu();

std::cout <<"\n";

std::cout << "\tOption: ";

std::cin >> option; 

system("cls"); 

switch (option) 

{  

case 1: 

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

std::cout << "\tWITHDRAW AMOUNT: ";

std::cin >>amt;

if (amt<=balance) {

balance -= amt; 

}

else  {

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

std::cout << "\tNOT ENOUGH MONEY" <<"\n\n\n";

std::cout<< "\tDO YOU WANT TO TRY AGAIN? (Y/N): ";

std::cin>>choice;

system("cls");

      }

break;

case 2:  

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

  std::cout << "\tDEPOSIT AMOUNT: ";

  std::cin >> a;  

  

  balance += a; 

  std::cout << "\tTOTAL ACCOUNT BALANCE IS: " << balance <<"\n\n";

  std:: cout<<"\tDO YOU WANT TO TRY AGAIN? (Y/N): ";

  std::cin>>choice;

system("cls");

break;

case 3: 

std::cout<<"\tDO YOU WANT TO TRY AGAIN? (Y/N): ";

std::cin>>choice;

system("cls");

break; 

}

if(choice=='y'||choice=='Y'){  

}

else if(choice=='n'||choice=='N'){

break;

else{

std::cout<<"\tPlease Choose in Y (Yes) or N (No):"; 

std::cin>>choice; }  

}while(choice!='n'||choice!='N'); 

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

std::cout << "\tEnd of Program\n\n";

  system("pause"); 

    std::cout <<"\n";

     }

    

void DisplayMenu() 

   {

   std::cout <<"\n";

   std::cout << "\tSELECT YOUR OPTIONS";

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

   std::cout << "\t[1] WITHDRAW MONEY" <<"\n";

   std::cout << "\t[2] DEPOSIT MONEY" << "\n";

   std::cout << "\t[3] EXIT" << "\n";

   }      

 

Wednesday, January 27, 2021

Power a Number in Ruby

Power of a Number in Ruby

 Design and create a program that will ask the user to give base and exponent values and then the program will compute the power value of the number and then 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 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

# power.rb
# Written By Mr. Jake Rodriguez Pomperada,BSCS,MAED-IT
# Tools : Ruby 2.6.3 and Sublime Text Editor 
# May 13, 2019    Monday   9:48 PM
# Bacolod City, Negros Occidental
# Website       : http://www.jakerpomperada.com
# Email Address : jakerpomperada@gmail.com

puts "\n\n"
print "\tPower of a Number in Ruby";
puts "\n\n"
print "\tEnter a Base Number : ";
base = gets;
print "\tEnter an Exponent   : ";
exponent = gets;

base = base.to_i;
exponent = exponent.to_i;

solve_power = (base ** exponent);

print "\n\n";
print "\tDISPLAY RESULTS";
print "\n\n";
print "\t#{base} ^ #{exponent} = #{solve_power}";
puts "\n\n";
print "\tEnd of Program";
puts "\n";

Greetings Program in Ruby

Greetings Program in Ruby

 Write a program that will ask the user to give its first name and last name and then the program will greet the person.

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

Problem

Write a program that will ask the user to give its first name and last name and
then the program will greet the person.

Solution

# greet.rb
# Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
# Date     : May 10, 2019     Friday
# Address  : Bacolod City, Negros Occidental
# Tools    : Sublime Text and Ruby Version 2.6.3
# Location : Bacolod City, Negros Occidental
# Website  : http://www.jakerpomperada.com
# Emails   : jakerpomperada@gmai.com and jakerpomperada@yahoo.com

print "\n\n";
print "\tGreetings Program";
print "\n\n";
print "\tGive your First Name : "
fname = gets.chomp
print "\n";
print "\tGive your Last Name  : "
lname = gets.chomp
print "\n\n";
print "\tHello #{fname.upcase} #{lname.upcase}.";
print "\n\n";
print "\tWelcome to Ruby Programming.";
print "\n\n";
print "\tEnd of Program";
print "\n";


Monday, January 25, 2021

Multiple Choice Trivia Quiz in Java

Multiple Choice Trivia Quiz in Java

 I wrote this simple multiply choice trivia quiz using Java programming language that shows how to use control statements, arrays, and methods in Java.

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


/**
 * @author Jake Rodriguez Pomperada, MAED-IT, MIT
 * jakerpomperada@gmail.com
 * www.jakerpomperada.com  / www.jakerpomperada.blogspot.com
 * Bacolod City, Negros Occidental, Philippines
 * January 25, 2021  Monday
 */

import java.util.Scanner;

public class Multiple_Choice_Quiz {    
   
 static Scanner Input = new Scanner(System.in);
 
 public static void display_program() {
 
   int correct = 0;

       int incorrect=0;

      int questions = 5;

      System.out.print("\n");
      System.out.println("Multiple Choice Trivia Quiz in Java");

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

       String[][] Ques_Ans = {

{"What game was created by Markus Persson in the Java programming language?","\n A. Pacman \n B. Minecraft \n C. Starcraft \n D. Battle City\n","B"},

{"What nba team Lebron James wins his 4th Championship ring? ","\n A. Chicago Bulls \n B. New York Knicks \n C. LA Lakers \n D. Boston Celtics\n","C"},

{"Who is the present President of the Philippines? ","\n A. Gloria Arroyo \n B. Rody Duterte \n C. Fidel Ramos \n D. Noynoy Aquino\n","B"},

{"Who is the founder of Microsoft? ","\n A. Bill Allen \n B. Peter Norton \n C. Bill Gates \n D. Mark Cuban\n","C"},

{"What NBA Team Tim Duncan played?","\n A. San Antonio Spurs \n B. Toronto Raptors \n C. Detriot Piston \n D. Booklyn Nets\n","A"}};



      String[] user_ans = new String[(int) questions];

      int i=0;

       

      do {

          System.out.print("" + (i+1) + ". " + Ques_Ans[i][0] + "   "+Ques_Ans[i][1]);

          user_ans[i] = String.valueOf(Input.next().charAt(0));

       
   
          if(Ques_Ans[i][2].equals(user_ans[i].toUpperCase())) {

              System.out.println("\n Correct Answer!");

               correct++; 
              

          }

          else

          {

              System.out.println("\n Incorrect. The correct answer is "+Ques_Ans[i][2]);

              incorrect++;

          }

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

          i++;

     }while(i<questions);                      

      System.out.print("\n");
      System.out.print("\t===== DISPLAY RESULTS =====");
      System.out.print("\n");
      System.out.println("\n Number of correct answers: "+ correct);
      System.out.println("\n Number of incorrect answers: "+ incorrect);
      System.out.print("\n");
      System.out.print("\tEnd of Program");
      System.out.print("\n");
      System.exit(0);

 }

    public static void main(String[] args){
    
    display_program();
        
    }



}