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
"Switches break up _______________ domains and routers break up _____________ domains."
mel-nik [20]

Answer:

Switches break up collision domains and routers break up broadcast domains.

Explanation:

  • Collision domain depicts the part within a network where a collision can happen.
  • Collision occurs when two hosts transmit data packet at the same time within a network. Theses packets collide and the hosts have to resend the data after some time.
  • Too many collisions can result in slow traffic speed and can effect network performance.
  • So switches break up collision domains between the devices on a network and each port in a switch depicts a collision domain. This reduces the chance of packet collisions between the devices or hosts.
  • When data is to be sent to a host, the switch keeps that data frame and waits for availability of the destination host before sending the data frame.
  • Moreover full duplex switch mode there is not chance of collision as the transmitting path on one host is the receiving path on other host.
  • Broadcast domain contains all the hosts that can reach each other at the Data Link layer via broadcast.
  • Routers break up broadcast domains as routers contain separate broadcast domains for each interface.
  • Routers do not forward broadcasts from one broadcast domain to other and drop the packet when they detect a broadcast address.
4 0
3 years ago
PLZ HELPPPPPPPPPPPPPPPPPPPP
kari74 [83]
C.....................
8 0
3 years ago
Select all that apply) Alex is designing a webpage for her composition course that summarizes her research project. As she prepa
marissa [1.9K]

Answer:

C. Purpose

Explanation:

The purpose of website should be determined and then text fonts and layout should be selected. The target audience of the website should be determined and it should be identified their preference so that website layout is designed in a way which impresses the audience and leaves an impact on them.

6 0
3 years ago
What kind of network is built around the concept of low-power transmitters built on towers that can use the same radio frequency
marishachu [46]

Answer:

Cellular telephone network

Explanation:

Cellular telephone network utilizes the concept of the such towers that allows the use of transmitters of low power and make use of the same channel for the radio frequency.

Cellular network is the network for communication in which the end link of the network is wireless. This type type of network is distributed and makes use of the radio waves over the land areas of the network referred to as the 'cells'. These cells are served individually by the fixed base station that enables the transmission of calls over a wide range through wireless links to a fixed receiver

4 0
3 years ago
A programming language that captures only the most primitive operations available to a machine. Anything that a computer can do
Anton [14]

Answer:

A. True.

Explanation:

Programming languages are computer based languages used to pass instructions or task that can be interpreted to machine language, which can be understood by the computer system. Low level programming language and high level programming language are the two categories of program languages.

Low level languages use low level commands. They use processor instruction sets and primitive opcodes for their instruction syntax. Example of a low level language is Assembly language.

High level languages are English based and more complex in its compilation.

8 0
3 years ago
Other questions:
  • What are some measurements used to determine water waste from leaking faucets?
    10·1 answer
  • Digital art is created by using
    6·1 answer
  • What is a social media networks
    5·1 answer
  • What was the process called that required the photographer to have a tent or darkroom handy so that chemicals could be mixed qui
    7·1 answer
  • The design of a blog refers to:
    10·1 answer
  • Write a program to read 10 integers from an input file and output the average, minimum, and maximum of those numbers to an outpu
    14·1 answer
  • Jared recently sent an email to all the members of his department asking them for their opinions about where the department shou
    11·1 answer
  • What are some of the ways we can resolve IPv4 address shortages? Check all that apply.
    13·1 answer
  • You are setting up a small network. The customer has decided to change his internet service provider (ISP) to EtherSpeed. The IS
    9·1 answer
  • The main part of your program has the following line of code.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!