ok here is what I got for the second problem, hopefully its done right, if anyone wants to check it and tell me if i need to change anything i would like that
import java.util.Scanner;
import java.text.DecimalFormat;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double rate;
int hours;
double grossPay;
System.out.println("Enter the number of hours worked per week: ");
hours = scan.nextInt();
System.out.println("Enter hourly pay rate: ");
rate = scan.nextDouble();
if(hours<=40){
System.out.println("Hours Worked:" + hours);
System.out.println("Pay Rate:" + rate);
grossPay = rate*hours;
DecimalFormat df = new DecimalFormat("#.##");
System.out.println("Gross Pay:" + df.format(grossPay));
}
else if(hours>40 && hours<=54){
System.out.println("Hours Worked:" + hours);
System.out.println("Pay Rate:" + rate);
grossPay = (rate*1.5)*hours;
DecimalFormat df = new DecimalFormat("#.##");
System.out.println("Gross Pay:" + df.format(grossPay));
}
else if(hours>54){
System.out.println("Hours Worked:" + hours);
System.out.println("Pay Rate:" + rate);
grossPay = (rate*2.0)*hours;
DecimalFormat df = new DecimalFormat("#.##");
System.out.println("Gross Pay:" + df.format(grossPay));
}
}
}