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
Katarina [22]
3 years ago
9

Fill in this function that takes three parameters, two Strings and an int. 4- // Write some test function calls here! The String

s are the message that should be printed. You should alternate printMessage("Hi", "Karel", 5); between the Strings after each line. The int represents the total number of lines that should be printed. public void printMessage(String lineOne, String lineTwo, in For example, if you were to call 19.
printMessage("Hi", "Karel", 5);
// Start here! 12 the function should produce the following output:
Hi
Karel
Hi
Kare
Computers and Technology
1 answer:
zimovet [89]3 years ago
8 0

Answer:

The function in Java is as follows:

public static void printMessage(String lineOne, String lineTwo, int lines){

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

           if(i%2 == 1){

               System.out.println(lineOne);

           }

           else{

               System.out.println(lineTwo);

           }

       }

   }

Explanation:

This defines the function

public static void printMessage(String lineOne, String lineTwo, int lines){

This iterates through the number of lines

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

String lineOne is printed on odd lines i.e. 1,3,5....

      if(i%2 == 1){

               System.out.println(lineOne);

           }

String lineTwo is printed on even lines i.e. 2,4,6....

           else{

               System.out.println(lineTwo);

           }

       }

   }

To call the function from main, use:

printMessage("Hi", "Karel", 5);

You might be interested in
¿Cuales son los dos estados de una computadora y que significa cada uno?
hjlf

Answer:

En ciencias de la computación, el estado de un circuito lógico digital o programa de computadora es un término técnico para toda la información almacenada a la que un circuito o programa tiene acceso en un momento dado. La información recibida previamente en las entradas se almacena en la memoria de elementos electrónicos, como disparadores, celdas de memoria. El contenido almacenado de estos elementos de memoria, en un momento dado, denominado colectivamente el "estado" del circuito, contiene toda la información sobre el pasado al que tiene acceso el dispositivo. Así, básicamente, una computadora puede tener acceso a dicho estado o no, según se encuentre encendida o apagada.  

4 0
3 years ago
In which scenario would someone most likely be
andrew11 [14]

Answer:

Option 1. Brent is preparing for his class speech

Explanation:

I chose option one because he would need presentation software to show his class about his speech

5 0
3 years ago
Which activity can be used to modify the value of an existing cell in a datatable
stepladder [879]

Answer:

The name of the activity is "Add Data Column".

Explanation:

Add data column activity is a part of the database that is used in used for adding a column in the database table. This activity also used in Windows.  

  • It provides attachment in windows activity by using Uipath studio.
  • The Uipath studio is used to connect with any application, that enables by windows, and to perform multiple operations on single user interface elements.
4 0
3 years ago
What is the smallest floating number can be represented in C++? -3.4*10^38
melisa1 [442]

Answer:

FLT_MIN.

Explanation:

In C++ FLT_MIN is used to represent the smallest floating point number.You have to include two libraries for FLT_MIN to work and these are as following:-

limits.h

float.h

for example:-

#include <iostream>

#include<limits.h>

#include<float.h>

using namespace std;

int main() {

   cout<<FLT_MIN;

return 0;

}

Output:-

3.40282e+38

8 0
3 years ago
Operating systems that have windows and icons have what type of user interface?
babymother [125]
Operating systems that have windows and icons have GRAPHICAL USER INTERFACE. Graphical user interface refers to a visual way of interacting with a computer by making use of items such as windows, icons, menu, etc. The interface allows the user to easily communicate with the computer by using symbols or pointing devices.
6 0
3 years ago
Other questions:
  • Arrange these stages of website design in the order that they follow. developing planning learning designing testing and deliver
    12·1 answer
  • Is a fundamental building block of a relational database because this object stores all of the data
    15·1 answer
  • A user of the wireless network is unable to gain access to the network. The symptoms are:1.) Unable to connect to both internal
    6·1 answer
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    8·1 answer
  • What are the controls in the Capture panel? Define each controls
    10·1 answer
  • Common separators or delimiters used when converting a table to text include _______________________ , paragraph marks, or comma
    14·1 answer
  • How many sets of number do both Hex and RGB values have?
    10·1 answer
  • Assume the user responds with a 3 for the first number and a 4 for the second number.
    13·1 answer
  • There's a rising issue with bots sending links starting with 'bit'. These links are dangerous and harmful for any computer or de
    6·2 answers
  • Which type of information should never be given out on social media?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!