repl.it
@timmy_i_chen/

Project #6A

Java

No description

fork
loading
Files
  • Main.java
  • jdt.ls-java-project
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
  System.out.println("Malik Abbas");
  System.out.println("Class Code:TQS21XC-01   Pd:1");
  System.out.println("Project #3");
  System.out.println("9/13/2019");
  System.out.println("Mr.Small");


  Scanner scan = new Scanner(System.in);
  System.out.println("Enter hourly rate: ");
  double rate = scan.nextInt();
  System.out.println("Enter the number of hours worked: ");
  double hours = scan.nextInt();

  double weekly = rate * hours;
  double monthly = weekly * 4;
  double yearly = weekly * 52;
  double overtimeRate = 40*rate+(hours-40)*rate*1.5;
  if(weekly > 40) {
  System.out.println("Your weekly salary is "+weekly);
  System.out.println("your monthly salary is "+monthly);
  System.out.println("your yearly salary is "+yearly);
  }
  else {
  System.out.println("Your weekly salary is " +overtimeRate);
  System.out.println("your monthly salary is "+overtimeRate*4);
  System.out.println("your yearly salary is "+overtimeRate*52);
  }
  }

}