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
(70 points) This is a legit question that I have for a device FOR my homework.
guapka [62]

Answer:

it might be locked down so hold down the button for 20 sec and do a hard shut down, if it doesn't cut on try holding it down for down for 30 secs.  . IF that doesn't work there should be a port next to the power button. you can connect a micro-b cable to the kindle and then connect it to a computer or laptop if you have one.  There is a video where it shows you how to take it apart and repair if none of this helps

Explanation:  i hope this helps

7 0
3 years ago
Read 2 more answers
Some technologies like vertical farming have a number of negative effects. Which is a negative outcome of this technology? A. In
Tanya [424]
<span>Vertical farming is the exercise of creating foodstuff and medication in sheer laden layers, vertically inclined exteriors and/or combined in other structures. The modern thoughts of vertical farming use indoor farming methods and controlled-environment agriculture (CEA) technology, where all environmental issues can be well-ordered. So knowing all of this, the negative outcome would be D.</span>
4 0
4 years ago
The _____ layer addresses how the software will execute on specific computers and networks.
lidiya [134]

The problem domain layer addresses how the software will execute on specific computers and networks.

A problem domain is a software engineering term that refers to all information that defines a problem and compels the solution.

A problem domain basically looks at only the area you are interested in and excludes the rest. It includes the goals the problem owner wishes to have and the context in which the problem exists. For example, if you are creating a website for selling artwork online, the problem domain will be artwork and eCommerce.

Therefore, in order to identify a problem domain, you need to know the relevant user requirements. This can be easy when you start by finding out what people (users) think the problem is.

#SPJ4

3 0
2 years ago
Read 2 more answers
The Windows Group Policy feature provides __________ that govern the way Windows operates in enterprise environments. a. a centr
WITCHER [35]

Answer:

a.

Explanation:

The Windows Group Policy feature provides a centralized set of rules that govern the way Windows operates in enterprise environments. The Windows Group Policy is found in every single Microsoft Windows operating system, and fully controls the working environment of user accounts and computer accounts. This feature allows the user to manually make restrictions and changes such as blocking access to certain sections of the Windows control panel or setting a specific website as the home page for every account on the network.

4 0
3 years ago
In the mouse properties Window, you Can
Dovator [93]
Change different options and settings to make your mouse pointer cooler. Like the buttons work, pointer looks, pointer works, wheel works and more.<span><span /></span>
4 0
3 years ago
Other questions:
  • Write a function getPigLatin(pigStr) that accepts pigStr as a parameter (a sentence as input) and converts each word to "Pig Lat
    8·1 answer
  • In an is framework, ________ is the bridge between the computer side on the left and the human side on the right
    12·1 answer
  • (Analyze scores) Write a program that reads an unspecified number of scores and determines how many scores are above or equal to
    10·1 answer
  • __________ is a program that lets you share documents online with others.
    12·2 answers
  • In C++ write a program that prints out PI as a type double and a type float EXACTLY as shown below. Your program should have ONE
    13·1 answer
  • PLEASE HELP!!!!!!!!!
    8·1 answer
  • Describe two types of storage devices?​
    15·1 answer
  • Which part of the computer is responsible for managing memory allocation for all applications
    12·1 answer
  • Do you guys answer questions about cyber security?
    10·1 answer
  • question 2 which data link layer protocol defines the process by which lan devices interface with upper network layer protocols?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!