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

Write a method printShampooInstructions(), with int parameter numCycles, and voi

ID: 3904761 • Letter: W

Question

Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "Too few.". If more than 4, print "Too many.". Else, print "N: Lather and rinse." numCycles times, where N is the cycle number, followed by "Done.". End with a newline. Example output for numCycles = 2:

import java.util.Scanner;

public class ShampooMethod {

/* Your solution goes here */

public static void main (String [] args) {
printShampooInstructions(2);
}
}

Explanation / Answer

import java.util.Scanner; public class ShampooMethod { static void printShampooInstructions(int numCycles) { if(numCycles < 1) { System.out.println("Too few.."); } else if(numCycles > 4) { System.out.println("Too many.."); } else { for(int i = 1; i
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