Question: public class Pay { public static void main ( String [ ] args ) { int hoursworked = Integer.parseInt ( args [ 0 ] )

public class Pay {
public static void main(String[] args){
int hoursworked = Integer.parseInt(args [0]);
double ratePerHour = Double. parseDouble(args [1]);
/* fill in code here */
double totalPay = hoursWorked * ratePerHour;
System.out.println(totalPay);
}
}.
A. To prevent the edge case of negative input, what needs to be filled in line
a. if(hoursWorked0|| rate P rHour0) System.exit();
b. if(hoursWorked0 && ratePerHour0) System.exit();
c. if(!(hoursWorked0 II ratePerHour0)) System.exit();
d. if(!(hoursWorked0 && ratePerHour0)) System.exit();
 public class Pay { public static void main(String[] args){ int hoursworked

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!