SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 6 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 18 Nov 2017 My Price 8.00

declaring the variables and constatnts in the code

Java 1

I am having issues with declaring the variables and constatnts in the code below. Its not a difficult program, but Im having issues with the math. Any help would be great.

I have the output formated as it needs to be, but I know I have the math messed up.

____________________-

 

import java.util.Scanner;

   

public class Wages

{

   static Scanner keyboard = new Scanner (System.in);

   

   public static void main(String[]args)

   {

       

       double rate = 12.50;

       double hoursWorked = 0;

       

       System.out.println("Enter the number of hours the employee worked");

       hoursWorked = keyboard.nextDouble();

       System.out.println();

       

       double regularHours =0;

       double overtimeHours = hoursWorked - regularHours;

       double regularWages = regularHours * rate;

       double overtimeWages = regularWages + (overtimeHours *rate*1.5);

       double totalPay = regularWages + overtimeWages;

       

       if (hoursWorked > 40.0)

           totalPay = regularHours * rate + 1.5 * rate *(hoursWorked - regularHours);

       

      

       else

           totalPay = rate * hoursWorked;

       

       System.out.println("****Wage Calculation****");

       System.out.println("Number of hours worked: " + hoursWorked); 

       System.out.println("Number of regular hours worked:" + regularHours);

       System.out.println("Amount of regular pay: " + regularWages);

       System.out.println("Amount of overtime pay: " + overtimeWages);

       System.out.println("Total Pay: $" + totalPay);

       System.out.println();

   }

}

      

Answers

(5)
Status NEW Posted 18 Nov 2017 06:11 AM My Price 8.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)