Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help for (i=0;i<3;i++) { System.out.println(\"Enter the first name and la

ID: 665043 • Letter: I

Question

I need help

for (i=0;i<3;i++)
{
   System.out.println("Enter the first name and last name of the employee: "); <=====THIS
   String name =in.nextLine();
  
   System.out.println("Enter the Employee pay rate: ");
   double payRate=in.nextDouble();
   if(payRate>75) when the user enters "76" it dose says "This employee dose not make that much" then it keep on going to the next line. I need it to go back to ask "Enter the Employee pay rate: "
  
       System.out.println("This employee dose not make that much");
       else if(payRate==0) <===
       {
           System.out.println("Error"); <===
       }
  
   }
   System.out.println("Enter the hours the employee worked: "); <===
   double workedHour=in.nextDouble();
   if(workedHour>72) <====
  
       System.out.println("Too many hours employee worked: ");<===
       else if (workedHour==0)
       {
           System.out.println("Error");
      
  
  

Explanation / Answer

Note:The code which you had given is make a change as per your requirement

for (i=0;i<3;i++)
{
   System.out.println("Enter the first name and last name of the employee: "); <=====THIS
   String name =in.nextLine();
  
   System.out.println("Enter the Employee pay rate: ");
   double payRate=in.nextDouble();
   if(payRate>75) when the user enters "76" it dose says "This employee dose not make that much" then it keep on going to the next line. I need it to go back to ask "Enter the Employee pay rate: "
  
       System.out.println("This employee dose not make that much");
       else if(payRate==0) <===
       {
           System.out.println("Error"); <===
       }
  
   }
   System.out.println("Enter the hours the employee worked: "); <===
   double workedHour=in.nextDouble();
   if(workedHour>72) <====
  
       System.out.println("Too many hours employee worked: ");<===
       else if (workedHour==0)
       {
           System.out.println("Error");

}

else if (userenters payrate>75)//code had changed

{

System.out.println(“Enter the Employee pay rate:”);

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote