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
REY [17]
3 years ago
15

Write a public static method named printArray, that takes two arguments. The first argument is an Array of int and the second ar

gument is a String. The method should print out a list of the values in the array, each separated by the value of the second argument.
Computers and Technology
1 answer:
Serjik [45]3 years ago
5 0

Answer:

Written in Java

public static void printArray(int myarr[], String s){

       for(int i = 0; i<myarr.length;i++){

           System.out.print(myarr[i]+s);

       }

   }

Explanation:

This defines the static method alongside the array and the string variable

public static void printArray(int myarr[], String s){

The following iteration iterates through the elements of the array

       for(int i = 0; i<myarr.length;i++){

This line prints each element of the array followed by the string literal

           System.out.print(myarr[i]+s);

       }

   }

The method can be called from main using:

<em>printArray(myarr,s);</em>

Where myarr and s are local variables of the main

You might be interested in
How to create a function, called separate_int_and_str, which takes in a list and separates out the integer values and strings in
gregori [183]

Answer:

program :

def separate_int_and_str(list_1):# function to seprate the list.

   str_list=[] #list to hold the

   int_list=[]#list which holds the integer value.

   for x in list_1: #for loop to extract the list.

       if(type(x)==str): #if condition to check the type of the element.

           str_list.append(x)#create a list for the string value.

       elif(type(x)==int): #check condition for th einteger value.

           int_list.append(x)#create a list for the integer value.

Explanation:

  • The above-defined function is written in the python language, which used the code to separate the list for integer and the string value.
  • There are two lists define in the function which holds the integer and the string value separately.
  • There is a 'for' loop which scans the element of the list and checks the list by the help of type function which tells the class of the element.
  • Then if the type function states that the element is from the strong class, it will assign the element on the string list otherwise it assigns the element in the integer list.
4 0
3 years ago
MARKING BRAINLIEST
BabaBlast [244]

Answer: Well, first of all, you might want to change websites. I suggest khan academy.

anyways if your a begnner *Like me* The you might wanna try Java Script! in other words i do not know how to work Python

8 0
3 years ago
Once you have saved a block of text for easy insertion in other documents, it will show up where?
kherson [118]
Click file and look up the name
7 0
2 years ago
Omar is ready to print the outlines. Which tab should he use to access the Print pane?
vivado [14]

Answer:

A. File

Explanation:

Edg2020

3 0
2 years ago
Read 2 more answers
Please help!!!
Leona [35]

Answer:

C. Forms often provide special tools such as drop-down boxes for finding data.

Explanation:

3 0
2 years ago
Other questions:
  • Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. It should
    5·1 answer
  • Your boss bought a new printer with a USB 3.0 port, and it came with a USB 3.0 cable. Your boss asks you: Will the printer work
    14·1 answer
  • The negotiators past relationship will affect current behavior if the parties
    12·1 answer
  • Which of the following is true? A)Checks and Debit Cards both withdraw money directly from a bank account. B)Checks are the most
    13·2 answers
  • Higher-speed Ethernet technologies use an electronic device known as a Hub rather than a switch True/False
    15·1 answer
  • Write the definition of a class employee base on the modular specification: . A data member for Id of type int (private). A data
    10·1 answer
  • Question 2 (2 points)
    6·1 answer
  • NEED HELP FAST timed
    13·1 answer
  • A small company with 100 computers has hired you to install a local area network. All of the users perform functions like email,
    9·1 answer
  • What is the name of the method generated when you double-click a button named btnprocess in the form designer?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!