subject

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 with input 2: 1: Lather and rinse. 2: Lather and rinse. Done. Hint: Declare and use a loop variable. import java. util. Scanner; public class ShampooMethod { /* Your solution goes here */ public static void main (String [] args) { Scanner scnr = new Scanner(System. in); int userCycles; userCycles = scnr. nextInt(); printShampooInstructions(userCycles ); } }

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
Describe in pseudocode an algorithm that given an integer n and a linked list of elements increases the linked list by a factor of n by replacing each element in the original list with n copies of that element. for example, if l: [18, 7, 4, 24, 11] and n = 3 the resulting list should be l: [18, 18, 18, 7, 7, 7, 4, 4, 4, 24, 24, 24, 11, 11, 11]. if the value of n is less than or equal to 0, the list should be empty after the call. what’s the running time of your algorithm?
Answers: 3
question
Computers and Technology, 22.06.2019 07:00
For all machines-not just hammers- the user applies force force to the machine to the machine over a certain distance. a. input b. output c. duo d. none of the above
Answers: 1
question
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
You know the right answer?
Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If nu...
Questions
question
Chemistry, 01.12.2020 23:50
question
Mathematics, 01.12.2020 23:50
question
Social Studies, 01.12.2020 23:50
question
History, 01.12.2020 23:50
question
Mathematics, 01.12.2020 23:50
Questions on the website: 13722360