Question: The following program redundantly repeats the same expressions many times. Modify the program to remove all redundant expressions using variables of appropriate types. public class
The following program redundantly repeats the same expressions many times. Modify the program to remove all redundant expressions using variables of appropriate types.
![public class ComputePay { public static void main (String [] args) {](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1606/7/2/3/4905fc4a7a2b31661606723403638.jpg)
public class ComputePay { public static void main (String [] args) { 3. // Calculate pay at work based on hours worked each day 4 System.out.println ("My total hours worked:"); System.out.println (4 + 5 +8 + 4); System.out.println ("My hourly salary:"); 8 System.out.println ("$8.75"); 10 System.out.println ("My total pay:"); 11 System.out.println ( (4 +5 + 8 + 4) * 8.75); 12 13 System.out.println ("My taxes owed:"); // 20% tax System.out.println ( (4 + 5 + 8 +4) 0.20); 14 8.75 15 16 2. 9.
Step by Step Solution
3.40 Rating (159 Votes )
There are 3 Steps involved in it
Version of ComputePay program that uses variables to avoi... View full answer
Get step-by-step solutions from verified subject matter experts
