answer.
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
Georgia [21]
2 years ago
3

Write a method markLength4 that takes an ArrayList of Strings as a parameter and that places a string of four asterisks "****" i

n front of every string of length 4. For example, suppose that a variable called list contains the following values: {"this", "is", "lots", "of", "fun", "for", "every", "Java", "programmer"} And you make the following call: markLength4(list); then list should store the following values after the call: {"****", "this", "is", "****", "lots", "of", "fun", "for", "every", "****", "Java", "programmer"} Notice that you leave the original strings in the list, "this", "lots", "Java", but include the four-asterisk string in front of each to

Computers and Technology
1 answer:
WARRIOR [948]2 years ago
8 0

Answer:

kindly check explainations for code output.

Explanation:

The program code below.

import java.util.ArrayList;

class MarkLength4

{

public static void main(String args[])

{

ArrayList s1=new ArrayList();

s1.add("this");s1.add("is");s1.add("lots");

s1.add("of");s1.add("fun");s1.add("for");

s1.add("every");s1.add("java");

s1.add("programmer");

int i;

System.out.println("Before Marking Length 4:");

System.out.print("s1=[");

for(i=0;i<s1.size();i++)

{

System.out.print(s1.get(i)+" ");

}

System.out.print("]\n");

markLength4(s1);

System.out.println("After Marking Length 4:");

System.out.print("s1=[");

for(i=0;i<s1.size();i++)

{

System.out.print(s1.get(i)+" ");

}

System.out.print("]\n");

}

public static void markLength4(ArrayList s1)

{

ArrayList t1=new ArrayList();

int size=s1.size();

int i;

for(i=0;i<size;i++)

{

String t=s1.get(i).toString();

if(t.length()==4)t1.add("****");

t1.add(s1.get(i));

}

s1.clear();

s1.addAll(t1);

}

}

Check attachment for output.

You might be interested in
Gwen recently purchased a new video card, and after she installed it, she realized she did not have the correct connections and
g100num [7]

Answer:

A. 8-pin PCI-E connector.

F. 6-pin PCI-E connector.

Explanation:

The video card is a peripheral hardware component in a computer system that is used to run videos and graphic files, providing the required memory, runtime and bandwidth.

The PCI-e or peripheral component interconnect express is a connector or expansion slot used specifically for adding and powering video cards on a computer system.

7 0
2 years ago
You want to register the domain name ABCcompany.org, but the registration service is not allowing you to do that. What's the mos
Andreyy89

Options :

The domain name is registered to someone else.

Domain names must end in ".com".

You are not the legal owner of ABC Company.

Domain names must be all in lowercase.

Answer:

The domain name is registered to someone else.

Explanation: In the scenario above, ABCcompany.org represents the domain name of a particular person or establishment which provides access to the website of the owner. The domain name given to an individual or website must be distinct, that is no two different organizations or persons can use exactly the same domain name. Domain names can end with :. com, org, ng and various other and they aren't case sensitive. Therefore, the inability to register the domain name abive will likely stem from the fact that the domain name has is already registered to someone else.

6 0
2 years ago
Identify the articulation site that allows us to nod our head ""yes"".
Luden [163]

Answer:

Occipital bone-atlas

Explanation:

The occipital bone is a bone that covers the back of your head; an area called the occiput. The occipital bone is the only bone in your head that connects with your cervical spine (neck).  The occipital bone surrounds a large opening known as the foramen magnum.

The foramen magnum allows key nerves and vascular structures passage between the brain and spine. Namely, it is what the spinal cord passes through to enter the skull. The brainstem also passes through this opening.

The foramen magnum also allows 2 key blood vessels traversing through the cervical spine, called the vertebral arteries, to enter the inner skull and supply blood to the brain

8 0
2 years ago
Sharon reads two different articles about avocados. The first article, in a weight loss magazine, claims that avocados are unhea
padilas [110]
The first and third.
3 0
2 years ago
Read 2 more answers
Anna bought a box of blueberries for £7. She used 700 grams for a cheesecake and she has 450 grams left. How much did the bluebe
xxTIMURxx [149]

0.61 (rounded up)

Explanation:

You add both 700 and 450 which will give you 1150g

You then divide 1150 by 100 which gives you 11.5

Then divide 7 by 11.5 which will give you 0.61 as cost of every 100 grams

8 0
2 years ago
Other questions:
  • Jane is designing a print brochure for a retail company. She’s having trouble deciding on the page margin. Which best practice w
    13·2 answers
  • Strlen("seven"); what is the output?
    14·1 answer
  • James has created some artwork portraying life on a different planet. He wants to show a world where everything is beautiful and
    7·1 answer
  • How does the discussion of “Luddites,” “Marx,” and “John Maynard Keynes” in paragraph 21 contribute to the development of the id
    7·1 answer
  • Workspace How do the following technologies help you in your quest to become a digital citizen: kiosks, enterprise computing, na
    6·1 answer
  • What does the binary odometer show about representing large numbers​
    15·1 answer
  • During the boot process, what does the processor do after the computer circuits receive power?
    13·1 answer
  • Write a program for determining if a year is a leap year. In the Gregorian calendar system you can check if it is a leaper if it
    15·1 answer
  • Jason Chang is creating photos of his restaurant for a new website. Some of the photos of the staff have red eye, others are bad
    7·1 answer
  • All of the following are true of functions except: Group of answer choices They define specific tasks that can be used at many p
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!