answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Greeley [361]
1 year ago
14

Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, prin

t "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); } }
Computers and Technology
1 answer:
iogann1982 [59]1 year ago
4 0

Answer:

import java.util.Scanner;

public class nu3 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter number of cycles");

       int numCycles = in.nextInt();

       //Call the method

       printShampooInstructions(numCycles);

   }

   public static void printShampooInstructions(int numCycles){

                if (numCycles<1){

              System.out.println("Too few");

          }

          if (numCycles>4){

              System.out.println("Too Many");

          }

          else {

              for (int i = 1;i <= numCycles; i++) {

                  System.out.println( numCycles+ ": Lather and rinse");

                  numCycles--;

              }

              System.out.println("     Done");

          }

   }

}

Explanation:

This is solved using Java programming language

The method printShampooInstructions() is in bold in the answer section

I have also provided a complete program that request user to enter value for number of cycles, calls the method and passes that value to it

The logic here is using if .... else statements to handle the different possible values of Number of cycles.

In the Else Section a loop is used to decrementally print the number of cycles

You might be interested in
Mrs. Johnson is here today to receive an intercostal nerve block to mitigate the debilitating pain of her malignancy. Her cancer
Furkat [3]

Answer:

The correct answer is:

a. M54.6, C79.51, C80.1

Explanation:

-  M54.6 Pain in thoracic spine. It is a billable/specific ICD-10-CM code that can be used to indicate a diagnosis for reimbursement purposes. The 2020 edition of ICD-10-CM M54.

- C79.51: Secondary malignant neoplasm of bone, it is a billable/specific ICD-10-CM code that can be used to indicate a diagnosis for reimbursement purposes.

- G89. 3 is a billable/specific ICD-10-CM code that can be used to indicate a diagnosis for reimbursement purposes. The 2020 edition of ICD-10-CM G89.

Malignant neoplasm of anus, unspecified

Neoplasm related pain (acute) (chronic)

Pain in thoracic spine. M54. 6 is a billable/specific ICD-10-CM code that can be used to indicate a diagnosis for reimbursement purposes. The 2020 edition of ICD-10-CM M54.

Malignant (primary) neoplasm, unspecified

- C80. 1 is a billable/specific ICD-10-CM code that can be used to indicate a diagnosis for reimbursement purposes. The 2020 edition of ICD-10-CM C80.

5 0
2 years ago
3) 5, 10, 15, 20 are items of data. Explain how these could become information and what knowledge
yKpoI14uk [10]

For example when there is research on how many people shoplift in a shopping centre per week. These numbers could show a increase in the number of shoplifters per week.

8 0
1 year ago
Identify a data type applied in an input element to create slider controls.
QveST [7]

Answer:

range

Explanation:

8 0
2 years ago
Write any 5 activities that help to remove bad events from the society?​
vova2212 [387]

Answer:

1. Awareness program

2. Education

3. women empowerment

6 0
1 year ago
Read 2 more answers
Use Excel to develop a regression model for the Consumer Food Database (using the "Excel Databases.xls" file on Blackboard) to p
m_a_m_a [10]

Answer:

Step 1 : Create an Indicator Variable for metro cities using formula mentioned in formula bar.

Step 2: Filter the Data on Metro cities i.e. select only those cities with Metro Indicator 1.

Step 3: Paste this filtered data to a new sheet.

Step 4: Go to Data - Data Analysis - Regression

Step 5: Enter the range of Y-variable and X-variable as shown. Select Output range and click on residuals. It will give you Output Summary and the Predicted Values along with Residuals

Please see attachment

5 0
2 years ago
Other questions:
  • Social networking sites like Office Online, PayPal, and Dropbox are used to develop social and business contacts.
    6·2 answers
  • Use a VLOOKUP function in cell I5 to identify and calculate the federal withholding tax. Use the tax rates from the range D21:E2
    15·1 answer
  • A ____ resembles a circle of computers that communicate with each other.
    14·1 answer
  • What company built its first computer from a wooden box
    12·2 answers
  • As you are planning your informative speech on the prevalence of Internet memes in pop culture and you wonder if your audience w
    14·1 answer
  • dam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correct
    9·1 answer
  • For any element in keysList with a value greater than 60, print the corresponding value in itemsList, followed by a semicolon (n
    14·2 answers
  • Which expansion slot is used by an NVMe compliant device?
    9·1 answer
  • A credit card company receives numerous phone calls throughout the day from customers reporting fraud and billing disputes. Most
    10·1 answer
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!