1answer.
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
Eva8 [605]
3 years ago
12

Define a function that takes two arguments: a string called strText and a number called intNumber. This function will use a repe

tition structure (a While or For loop) to print strText intNumber of times. Call this function.
Computers and Technology
2 answers:
galben [10]3 years ago
6 0
<h2>Answer:</h2>

// Class declaration

public class Printer {  

   // Define the function and call it printMany

   // The return type is void since it doesn't necessarily return any value.

   // It just prints to the console.

   // It takes two arguments strText of type String and

   // intNumber of type int.

  public static void printMany(String strText, int intNumber){          

       // Initialize the loop counter i to 1;

       int i = 1;

      // Create a while loop that goes

      // from <em>i = 1</em> to  <em>i = intNumber</em>.

      // Where intNumber is the number of times the string strText

      // will be printed.

      while(i <= intNumber) {

           

            // At each of the cycle of the loop;

           // print out the string strText

           // and increment the value of the loop counter by 1

           System.out.println(strText);

           i++;

       }                 // End of while loop

   }               // End of method, printMany, declaration

// Write the main method to call the printMany function

public static void main(String[] args) {

       // Call the printMany function by supplying sample arguments;

       // In this case, strText has been given a value of "Omobowale"

       // And intNumber has been given a value of 4

       // Therefore, "Omobowale" will be printed 4 times.

       printMany("Omobowale", 4);

   }            //  End of main method

}          // End of class declaration

<h2>Sample Output: </h2>

<em>When the program above is run, the following will be the output;</em>

<em>----------------------------------------------------</em>

Omobowale

Omobowale

Omobowale

Omobowale

-------------------------------------------------------

<h2>Explanation:</h2>

Comments:

* The above code has been written in Java

* The code contains comments explaining every part of the code. Kindly go through the comments.

The whole code without comments is re-written as follows;

public class Printer {      

   public static void printMany(String strText, int intNumber){    

       int i = 1;

       while(i <= intNumber){

           System.out.println(strText);

           i++;

       }

   }      

   public static void main(String[] args) {

       printMany("Omobowale", 4);

   }

}

natima [27]3 years ago
3 0

Answer:

public class Main

{

   public static void printString(String strText, int intNumber) {

       for(int i=0; i<intNumber; i++){

           System.out.println(strText);

       }

   }

   

public static void main(String[] args) {

       

       printString("Brainly", 3);

}

}

Explanation:

- Define a function called <em>printString</em> that takes two parameters - a String and an int. Since the function will print out the given String, it's type will be <u>void</u>.

- Use <em>for loop</em> to iterate according to the given number and print the given string

- In the main, call the <em>printString </em>function with some parameters.

You might be interested in
In Microsoft word you can access the blank command from the mini toolbar
Softa [21]
Your answer would be:
<span>
In Microsoft Word you can access the </span><span>insert citation command from the mini toolbar.</span>
3 0
3 years ago
How has the Internet changed the design industry?
Alexandra [31]
<span>Loads of ‘easy to use’ programmes and ‘How To’ guides make it simple for anyone to put a brochure/newsletter/marketing piece together – how difficult can it be with so much help available? Technology has not only changed the way designs are accomplished, it’s changed the perception of ‘design’ from a hard earned skill to something you can learn in an afternoon off.

via </span>https://dmjcomputerservices.com/blog/technology-changed-design-industry/

4 0
3 years ago
WILL GIVE BRAINLIEST!!!!!!!
denpristay [2]

Answer:

A drill is one of the most important tools a dentist can have. They run on pneumatic systems which gives the drill power and precision.

Explanation:

So, false

3 0
2 years ago
Read 2 more answers
Write a program for TIC TAC TOE in PYTHON
masya89 [10]

Answer: much too long to write here: see attached

Explanation:

3 0
3 years ago
What is the purpose of the property, transition-timing-function?
oksano4ka [1.4K]

Answer:

It changes the speed at different stages of the transition.

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head. The head contains information such as version of HTML, title of a page, metadata, link to custom favicons and CSS etc. The body of the HTML document contains the contents or informations that a web page displays.

Basically, the purpose of the property, transition-timing-function is that It changes the speed at different stages of the transition. Thus, it states the values between the beginning and ending of a transition are calculated over its duration.

4 0
3 years ago
Other questions:
  • Which organizational pattern would probably be most effective for arranging the main points of a speech with the specific purpos
    15·1 answer
  • What shooting position is commonly used when hunting with a shotgun?
    14·2 answers
  • Which data type or collection of data types can SOQL statements populate or evaluate to?
    9·1 answer
  • The number of bits per pixel is called what
    7·1 answer
  • Implement a recursive method named power that takes 2 integer parameters named base and expo. The method will return the base ra
    6·1 answer
  • ___________ is an approach to boundary spanning that results from using sophisticated software to search through large amounts o
    8·1 answer
  • Someone please help me with the right answer please
    12·1 answer
  • When you connect a device to your computer for the first time, Windows Media Player selects the ____ method that works best for
    15·2 answers
  • State the Limitations of the first generation of computers​
    8·1 answer
  • What are two differences between a wide angle lens and a telephoto lens?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!