Fill in this function that takes three parameters, two Strings and an int. 4- // Write some test function calls here! The Strings 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

Answers

Answer 1

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);


Related Questions

Write a function in Java called factorial() that will take a positive integer as input and returns its factorial as output.

Answers

Answer:

The function is as follows:

public static int factorial(int n){

       int fact = 1;

       for(int i=2;i<=n;i++){

           fact*=i;

       }

       return fact;

   }

Explanation:

This line defines the function

public static int factorial(int n){

This declares and initializes variable fact to 1    

  int fact = 1;

This iterates from 2 to n

       for(int i=2;i<=n;i++){

This line multiplies all integers from 1 to n

           fact*=i;

       }

This returns the factorial

       return fact;

   }

What will be the output?
name = "Dave"
print(name)
A. name
B. "Dave"
C. Dave
D. (name)

Answers

i believe it’s c, sorry if im wrong

Which daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is needed

Answers

Answer:

Swap daemon

Explanation:

Swap daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is needed. The main function of the swap daemon is to monitor processes running on a computer to determine whether or not it requires to be swapped.

The physical memory of a computer system is known as random access memory (RAM).

A random access memory (RAM) can be defined as the internal hardware memory which allows data to be read and written (changed) in a computer.Basically, a random access memory (RAM) is used for temporarily storing data such as software programs, operating system (OS),machine code and working data (data in current use) so that they are easily and rapidly accessible to the central processing unit (CPU).

Additionally, RAM is a volatile memory because any data stored in it would be lost or erased once the computer is turned off. Thus, it can only retain data while the computer is turned on and as such is considered to be a short-term memory.

There are two (2) main types of random access memory (RAM) and these are;

1. Static Random Access Memory (SRAM).

2. Dynamic Random Access Memory (DRAM).

To lose weight, you must _______.

a.
increase exercise and increase caloric intake
b.
increase exercise and decrease caloric intake
c.
decrease exercise and increase caloric intake
d.
decrease exercise and decrease caloric intake

Answers

Answer:

B

Explanation:

because you need to exercise and eat or drink less calories

Answer: b. increase exercise and decrease caloric intake

Explanation:

With what speed will a clock have to be moving in order to run at a rate that is one-half the rate of a clock at rest

Answers

Answer:

Speed = 0.866c

Where c is speed of light

Explanation:

We want to find the speed at which it run at a rate that is one-half the rate of a clock at rest.

Thus, we will use time dilation equation to solve it.

Thus;

t_o/√[1 - (v²/c²)] = 2t_o

Where:

t_o is time at rest

v is the speed at which it runs

c is the speed of light.

t_o will cancel out to give;

1/√[1 - (v²/c²)] = 2

Rearranging, we have;

√[1 - (v²/c²)] = ½

Let's make v the subject of the formula;

Let's square both sides to get;

1 - (v²/c²) = ½²

1 - (v²/c²) = ¼

Rearrange to get;

1 - ¼ = v²/c²

¾ = v²/c²

Take square root of both sides to get;

v/c = √¾

v = c × 0.866

v = 0.866c

What would the proper initialization and declaration be for an ArrayList myTemps meant to store precise temperature measurements

Answers

Answer:

Explanation:

When dealing with the Java programming language you need to first declare the variable type and then initialize that variable. Since precise temperature measurements would be in a double format (example: 98.3) then the proper way to do this would be with the following code.

ArrayList<Double> myTemps = new ArrayList<Double>();

               myTemps.add(98.3);

               myTemps.add(33.2);

               myTemps.add(48.5);

This code declared the ArrayList as type Double and added three elements to the array

The proper  initialization and declaration should be shown below.

Proper initialization and declaration:

At the time of dealing with the programming language i.e. JAVA here we required to first see the type of variable after this we have to initialize it. The measurment of the temperature should be in the double format example 98.3

So, the following code should be used.

ArrayList<Double> myTemps = new ArrayList<Double>();

              myTemps.add(98.3);

              myTemps.add(33.2);

              myTemps.add(48.5);

This code should be declared the ArrayList since type Double and added three elements to the array.

Learn more about array here: https://brainly.com/question/24348246

The BaseballPlayer class stores the number of hits and the number of at-bats a player has. You will complete this class by writing the constructor. Write a method called: public BaseballPlayer() The constructor should take three parameters to match the three instance variables in the class and then initialize the instance variables with these parameters. The parameters should be ordered so that the name of the baseball player is input first, then their hits, and at bats. In the BaseballTester class, print a call to printBattingAverage to test your constructor.

Answers

Answer:

Answered below

Explanation:

Class BaseballPlayer{

//Instance variables

string name;

int hits;

int bats;

//Constructor

BaseballPlayer (string a, int b, int c){

name = a;

hits = b;

bats = c

}

public void printBattingDetails( ){

System.out.print(name, hits, bats)

}

}

//Demo class

Class BaseballTester{

public static void main (String args []){

BaseballPlayer player = new BaseballPlayer("Joe", 8, 4)

player.printBattingDetails( )

}

}

I need help please!!!!

Answers

Just restart it and it will be fixed
unplug the whole thing and then plug it back in maybe?

in speech writing, it can be defined as all aspect of your writing that help the reader move smoothly from one sentence to the next , and form one paragraph to another

Answers

Answer:

Logical flow

Explanation:

In speech writing, LOGICAL FLOW can be defined as all aspects of your writing that helps the reader move smoothly from one sentence to the next, and from one paragraph to another.

With the Logical flow, one will be able to guide his thoughts coherently and sequentially in which Readers can fully absorb and easily understand the message.

What is the missing line?

>>> myDeque = deque('math')

>>> myDeque

deque(['m', 'a', 'f'])

O >>> myDeque popleft

O >>> myDeque.clear()

O >>> my Deque pop

O >>> myDeque.clear()

Answers

Correct question:

What is the missing line?

>>> myDeque = deque('math')

>>> myDeque

deque(['m', 'a', 't'])

Answer:

myDeque.pop()

Explanation:

The double ended queue, deque found in the python collection module is very similar to a python list and can perform operations such as delete items, append and so on.

In the program written above, the missing line is the myDeque.pop() as the pop() method is used to delete items in the created list from the right end of the list. Hence, the 'h' at the right end is deleted and we have the output deque(['m', 'a', 't'])

myDeque.popleft () deletes items from the right.

Write a method that takes a Regular Polygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclusive, and sets its side length to a random decimal number greater than or equal to 5 and less than 12. Use Math.random() to generate random numbers. This method must be called randomize() and it must take a Regular Polygon perimeter.

Answers

Answer:

Answered below

Explanation:

//Program is written in Java programming language

Class RegularPolygon{

int sides = 0;

int length = 0;

}

public void randomize(RegularPolygon polygon){

int randomSides = (int) 10 + (Math.random() * 20);

double randomLength = 5 + (Math.random() * 11);

polygon.sides = randomSides;

polygon.length = randomLength;

}

Assume the following:

1. An organizational unit has 2 database servers, 2 application servers, and 15 clients.
2. Database server performs data storage and data access logic.
3. Application server performs business (or application) logic.
4. One database server and one application server are used to address any client's request.

Question: Such a client-server architecture would be typically classified as:

a. 4-tier architecture (because there are four servers in this network).
b. 5-tier architecture (because there are four servers and one client in the network).
c. 3-tier architecture (because the database server, the application server, and the client each represent one tier respectively).
d. n-tier architecture, where n=19 (because there are 19 computers in the network).

Answers

Answer:

c. 3-tier architecture (because the database server, the application server, and the client each represent one tier respectively).

Explanation:

This is a 3 tier client server architecture, it has the 3 major components that makes up this system

It has the client server, an application server and lastly it has the backend database server.

Each of these 3 tiers in this question are assigned one particular task. This would make functionality to be improved and can also help to find issues that may arise during the testing and production stages.

software products that would be beneficial to both small and large businesses.
Find software that would be beneficial to a small business only.
Find software that would be beneficial to a large business only.​

Answers

Answer:

HTML,C++,Maya for animation..etc including DoC apps etc

what is the job of a bootloader?

Answers

Answer:

A bootloader, also known as a boot program or bootstrap loader, is a special operating system software that loads into the working memory of a computer after start-up.

Explanation:

A boot loader is a special operations system that makes your computer remember stuff. It’s programmed into storage which you used to save files and many other things. Without the boot laser you computer would not be able to start up, run at full capacity, and so many more things

>>> phrase = "abcdefgh"

>>> phrase[3:6]

Answers

Answer:

Following are the correct code to this question:

phrase = "abcdefgh"#defining a variable phrase that holds a string value

print(phrase[3:6])#use print method for slicing and print its value

Output:

def

Explanation:

In the above code, a variable "phrase" is defined that holds a string value, and use a print method, inside the method, the variable is used as a list and use slicing.

It is a characteristic that enables you to access the series parts like strings, tuples, and lists. It also uses for modifying or removing objects in series, in the above slicing it starts from 3 and ends when it equal to the 6th letter, that's why it will print "def".

Compared with a star topology, a hierarchical topology: a. is more effective at handling heavy but short bursts of traffic. b. allows network expansion more easily. c. offers a great deal of network control and lower cost. d. has cable layouts that are easy to modify.

Answers

Answer:

c. offers a great deal of network control and lower cost.

Explanation:

A network topology can be defined as a graphical representation of the various networking devices used to create and manage a network.

Compared with a star topology, a hierarchical topology offers a great deal of network control and lower cost.

java Two smallest numbers Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. You can assume that the list will have at least 2 integers and fewer than 20 integers. Ex: If the input is: 5 10 5 3 21 2 the output is: 2 and 3 To achieve the above, first read the integers into an array. Hint: Make sure to initialize the second smallest and smallest integers properly.

Answers

Answer:

The code to this question can be defined as follows:

import java.util.*;//import package for user input

public class Main //defining a class

{

public static void main(String[] args)//defining main method  

{

   int m1,m2,num,t,i;//defining integer variable

   Scanner incx = new Scanner(System.in);//creating Scanner class object

   m1 = incx.nextInt();//input value

   m2 = incx.nextInt();//input value  

   if (m1 > m2)//use if block to check m1 greater than m2  

   {//swapping value

       t = m1;//holding m1 value in t

       m1 = m2;//defining m1 that take m2

       m2 = t;//holding m2 value  

   }

   for (i = 2; i < 6; i++)//defining for loop  

   {

       num = incx.nextInt();//input value  

       if (num < m1) //defining if block to smallest value

       {

           m2 = m1;//holding m2 value in m1

           m1 = num;//holding num value in m1

       }  

       else if (num < m2)//defining if block to smallest value  

       {

           m2 = num;//holding num value in m2

       }

   }

       System.out.println(m1 + " " + m2);//print two smallest values

   }

}

Output:

5

10

5

3

21

2

2 3

Explanation:

In the above code, five integer variable "m1, m2, num, t, and i" is declared, in which it creates the scanner class object for inputs the value and use m1 and m2 use to the input value.

In the next step, if a block is used to swap the value and pass into the for loop that use if block to find the two smallest values and hold its value into the m1 and m2 and print its value.

How we ingest streaming data into Hadoop Cluster?

Answers

Hadoop could be described as an open source program to handle big data. By utilizing the MapReduce model, Hadoop distributes data across it's nodes which are a network of connected computers. This data is shared across the systems and thus enables it to handle and process a very large amount dataset at the same time. These collection of networked nodes is called the HADOOP CLUSTER.

Hadoop leverages the power and capabilities of it's distributed file system (HDFS) which can handle the reading and writing of large files from log files, databases, raw files and other forms of streaming data for processing using ingestion tools such as the apache Flume, striim and so on. The HDFS ensures the ingested data are divided into smaller subunits and distributed across systems in the cluster.

Learn more : https://brainly.com/question/15548105

Please explain election technology

Answers

Answer:

Technlogy is the application of scientific knowledge for practical purposes, especially in industry.

Explanation:

Col 1 Col2 Col 3
Row 1 23.1 13.58 14
Row 2 56.783 46.29 45.71
Write a program that accomplishes the following objectives:
1. reads in the number of rows, then the number of columns,
2. using nested FOR loops, reads in the column data for each row,
3. adds up the data for each row and derives an average for each row,
4 also adds up all the data in the table and derives an overall average.
Hints
1. Look at slides 3 and 4 of CS1336_Lect5e_nested_loops.pptx and Pr5-14.cpp for samples of nested FOR loops, especially line 38 in slide 4 for a calculation of average per student. That is very much like a row average.
2 Have two running total variables, for example rowsum and totalsum. Initialize totalsum to 0 in the beginning of the program Initialize rowsum to 0 before the inner loop (see line 29 in slide 4). Keep running totals for both of these inside the inner loop (see line 36 in slide 4). Average the rowSum after each iteration of the inner loop (see line 38 in slide 4). Average the totalsum after the outside loop ends
When the input is as shown in Figure 1. your program should produce the output as shown in Figure 2.
Figure 1: (sample input) 23 23.1 13.58 14 56.783 46.29 45.71
Figure 2 (sample output) Lverage of data in row #1 is 16.89 Average of data in row #2 is 49.59 Average of all data is 33.24

Answers

Answer:

In C++:

#include<iostream>

using namespace std;

int main(){

int rows, cols;

cout<<"Rows: "; cin>>rows;

cout<<"Columns: "; cin>>cols;

int rowsum = 0; int totalsum = 0;

float nums[rows][cols];

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

for(int j = 0;j<cols;j++){

cout<<"Row "<<i+1<<", Column "<<j+1<<": ";

cin>>nums[i][j];

rowsum+=nums[i][j];  totalsum+=nums[i][j];

}

cout<<"Average of row "<<i+1<<": "<<(rowsum*1.0/cols*1.0)<<endl;

rowsum = 0;

}

cout<<"Overall Average: "<<(totalsum*1.0)/(rows*cols*1.0);

return 0;

}

Explanation:

This line declares number of rows and number of columns as integer

int rows, cols;

This line prompts user for number of rows

cout<<"Rows: "; cin>>rows;

This line prompts user for number of columns

cout<<"Columns: "; cin>>cols;

This line initializes rowsum and totalsum to 0, respectively

int rowsum = 0; int totalsum = 0;

This line declares a 2d array

float nums[rows][cols];

The following iteration gets user input into the array

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

for(int j = 0;j<cols;j++){

cout<<"Row "<<i+1<<", Column "<<j+1<<": ";

cin>>nums[i][j];

This line sum up the rows

rowsum+=nums[i][j];  

This line sum up each entry

totalsum+=nums[i][j];

}

This line calculates and prints the average of each row

cout<<"Average of row "<<i+1<<": "<<(rowsum*1.0/cols*1.0)<<endl;

rowsum = 0;

}

This line calculates and prints the overall average

cout<<"Overall Average: "<<(totalsum*1.0)/(rows*cols*1.0);

What is Machine Learning (ML)?​

Answers

Answer:

its where you learn about machines

This element is known as the path a dot makes. It can be used to create
contour drawings or to shade areas.
O Color
Contrast
Line
O Value
O None of the above

Answers

the answer is Value

i just know

NEED ASAP DUE TODAY

Complete the statement referring to the types of light exposure.

____means reflecting too much light into the camera, making the image appear brighter than the normal exposure.​

Answers

Answer:

Normal

Explanation:

Squares. Write a program class named SquareDisplay that asks the user for a positive integer no greater than 15. The program should then display a square on the screen using the character ‘X’. The number entered by the user will be the length of each side of the square. For example, if the user enters 5, the program should display the following:

XXXXX
XXXXX
XXXXX
XXXXX
XXXXX
INPUT and PROMPTS. The program prompts for an integer as follows: "Enter an integer in the range of 1-15: ".

OUTPUT. The output should be a square of X characters as described above.

CLASS NAMES. Your program class should be called SquareDisplay

Answers

Answer:

import java.util.Scanner;

class SquareDisplay {

 public static void main(String[] args) {

   Scanner scan = new Scanner(System.in);

   System.out.print("Enter an integer in the range of 1-15: ");

   int num = scan.nextInt();

   if ((num > 0) && (num <= 15)) {

     String s = "X".repeat(num) + "\n";

     System.out.print(s.repeat(num));

   } else {

     // your error handling

   }

   scan.close();

 }

}

Explanation:

The Word feature that would allow you to insert fields from an Access database into multiple copies of a Word document is called

Answers

Answer:

Mail Merge.

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users type, format and save text-based documents.

Microsoft Access can be defined as a software application or program designed by Microsoft corporation to avail end users the ability to create, manage and control their database.

A Mail Merge is a Microsoft Word feature that avails end users the ability to import data from other Microsoft applications such as Microsoft Access and Excel. Thus, an end user can use Mail Merge to create multiple documents (personalized letters and e-mails) at once and send to all individuals in a database query or table.

Hence, the Word feature that would allow you to insert fields from an Access database into multiple copies of a Word document is called Mail Merge.

An amount of money P is invested in an account where interest is compounded at the end of the period. The future worth F yielded at an interest rate i after n periods may be determined from the following formula: 

F=P(1+i)n.F=P(1+i)n.
Write a program that will calculate the future worth of an investment for each year from 1 through n. The input to the function should include the initial investment P, the interest rate i (as a decimal), and the number of years n for which the future worth is to be calculated. The output should consist of a table with headings and columns for n and F. Run the program for P = $100,000, i=.05, n=10 years F=P(1+i)nF=P(1+i)n

Modify the problem by using the following general formula for compounding interests: F=P(1+i/m)^mn where, m is the number of interest payments per year. Solve the problem for m=1 (annual) and m=12 (monthly).

Answers

Answer:

def future_worth(p,i,n):

   print("n \t F")

   for num in range(1, n+1):

       F = round(p * ((1 + i)** num), 2)

       print(f"{num}\t{F}")

future_worth(100000, .05, 10)

Explanation:

The "future_worth" function of the python program accepts three arguments namely the P (amount invested), i (the interest rate), and n (the number of years). The program runs a loop to print the rate of increase of the amount invested in n number of years.

True or False: Mapping annotations are exclusive - an annotated method will only be accessible to requests sent to a matching URL, with no partial matches

Answers

Answer:

False

Explanation:

Mapping annotation requires configured requests that are forwarded to default server and an error  is not raised. It has various URL attributes that are matched. The requests are sent to the URL that matches with the annotation.

Click this link to view O'NET's Work Styles section for Veterinarians.

Note that common work styles are listed toward the top, and less common work styles are listed toward the bottom.

According to O'NET, what are common work styles needed by Veterinarians? Check all that apply.

efficiency

attention to detail

integrity

dependability

self control

enterprising

analytical thinking

artistic

Answers

Answer: efficiency

attention to detail

integrity

self control

analytical thinking

Explanation:

Veterinarians are simply called the doctor's that attend to the needs of animals. They treat and take care of animals such as cats, pigs, dogs, and birds.

According to O'NET, the common work styles needed by Veterinarians include

efficiency, attention to detail, integrity, self control and analytical thinking.

Answer:

its

attention to detail

integrity

dependability

self control

analytical thinking

Explanation:

just took it its right :)

if a touch screen chrome is not charging what is wrong with it



sis chromebook aint charging plz help you get 10 points

Answers

look it up on a best buy website ion know

Answer:

A try buying a new charger if that dont work then try going to best buy to fix it after that ion rlly know

Explain in your own words the complication of history in voting technology

Answers

Answer:

Voting technology is complicated because it is hard to make sure that the votes are counted correctly.

Other Questions
Pls i need a answer 3 more... At a pizza restaurant, Mason earns $7.25 per hour to deliver pizzas and $9.00 per hour to make pizzas. One week he earned total of $288.75. During that week he made pizzas for 20 hours. The equation 7.25h + 9(20) = 288.75 could be used to find h, the number of hours he spent delivering pizzas. How many hours that he spent delivering pizzas? b) Name the triangle based on its angles. What largely Christian areas in a.d. 600 had no Christian presence in a.d. 325 find four solutions for the following linear equations your answer must include at least two positive numbers for X and at least two negative numbers for X. Do not choose 0 for the x coordinate express your answer in the form x, y Why did the Spanish really come to Mexico? A. for wealth (gold)B. to establish a governmentC. to learn Aztec cultureD. to stop the U.S. A baby carriage is rolling down a hill. Take into consideration, the carriage has 90J of kinetic energy and the mass of the carriage is 0.5m. If you can only run at a speed of 10m/s, will you catch the baby carriage? What is the velocity of the carriage? Archeologists discover four outer walls of an ancient building, as shown.If the missing walls are the same lengths as the discovered walls, how manysides did the original building have? Explain. 10. The model below represents an equation.What is the solution to the equation?A. X= 3B. X= 4 1/3C. 13D. 19 !!!!WILL GIVE BRAINLIEST!!!! I NEED HELP ASAP PLEASEEEE!!!!! In a unit circle, =180. What is the terminal point?A. (1,0)B. (0,-1)C. (0,1)D. (-1,0) Sonia rolls a six-sided number cube 12 times and records if she rolls a 2. What is the number of trials for this binomial experiment?261218 The prediction that is most supported by the passage is that Guest will say the note was written by Hyde. Jekyll. Lanyon. Utterson. HELP PLEASE!!!!according to the bar graph what was one way the us involment in the WWI helped the allies? Which of the following expresses a complete sentence?Which the salesman was surprised to find in such good shape.While waiting for her neighbor to move the car that blocked the driveway.By making sure that no one will park across the driveway again.The nineteen-year-old car looked out of place next to the new models. please help me out on this !!! what is 47.15 with 20% tip Solve the problem.Rob, a marine biologist, observesa dolphin pod with a 6:4male-to-female ratlo. The podhas 18 males. How many moremales than females are in thedolphin pod? Henry rolls a fair dice 24 times. How many times would Henry expect to roll a five? Why did Egyptians bury daily