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
Aliun [14]
3 years ago
7

Write a print10() method that takes an array as a parameter and prints out the first 10 words of the array.

Computers and Technology
1 answer:
hammer [34]3 years ago
3 0

Answer:

This question is answered using Java programming language:

public static void print10(String[]arr){

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

System.out.println(arr[i]);

    }

}

Explanation:

This line defines the method

public static void print10(String[]arr){

This iterates from 0 to 9 index of the array. In other words, 1st to 10th

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

This prints the required output (one on a line)

System.out.println(arr[i]);

    }

}

<em>Refer to attachment for the complete program that includes the main method.</em>

Download txt
You might be interested in
E lvl:
Alexxandr [17]
I’m cool here here here pizza
5 0
3 years ago
which of the following are advantages of a wide area network, as opposed to a local area network? select two options
AnnZ [28]

Answer:

Advantages of Wide Area Network as opposed to the Local Area Network:

Because of wide area network (WANs) connections are available from house to house, city to city, country to country. For ex: Internet.

WAN is connecting the devices with various wireless technologies such as: cell phone towers or satellites. All these are much harder to setup with LANs.

Local Area Network (LANs) connections can only operate in a local area, not bigger than a house or a floor in a office building and also you cannot buy a ethernet cable that can reach throughout entire building and Wi-Fi connection rapidly disconnected as you get further then few meters away.

3 0
3 years ago
Debug the following program.
mamaluj [8]

Answer:

The debugged program is as follows:

A=2

B=2

For I=1 to 10

PRINT A

TEMP = A

A=B

B=TEMP+A

NEXT I

END

Explanation:

First, the value of B should be changed to 4 (because the second term of the sequence is 2

Next, change Display to Print because Q-basic uses the print keyword to display output

The sequence is not properly generated. So, I update that part of the program to:

<em>For I=1 to 10 </em>

<em>PRINT A </em>

<em>TEMP = A </em>

<em>A=B </em>

<em>B=TEMP+A </em>

<em>NEXT I </em>

<em />

Lastly, the loop is controlled by variable I (not X).

So change NEXT X to NEXT I

4 0
3 years ago
I need help to make this code to make it remove all instances of the specified letter from the original sentence
Agata [3.3K]
Here is my solution. I did the following:

- changed the setRemover into a constructor, since the comment seems to hint that that is expected.
- changed the lookFor type into a String, so that it can work with the string replace overload. That's convenient if you want to replace with an emtpy string. The char type won't let you do that, you can then only replace one char with another.
- Added a static Main routine to use the class.

import java.lang.System.*;

public class LetterRemover 
{
   private String sentence;
   private String lookFor;

   public LetterRemover() {}
   
   // Constructor
   
   public LetterRemover(String s, char rem)
   {
       sentence = s;
       lookFor = String.valueOf(rem);
   }
   
   public String removeLetters()
   {       
       String cleaned = sentence.replace(lookFor, "");       
       return cleaned;
   }
   
   public String toString()
   {
       return sentence + " - letter to remove " + lookFor;
   }

   public static void main(String[] args) 
   {
        LetterRemover lr = new LetterRemover("This is the tester line.", 'e');
        System.out.println(lr.toString());
        String result = lr.removeLetters();        
        System.out.println("Resulting string: "+result);
   }
}

5 0
3 years ago
Cuales son los multiplos de hertz
saw5 [17]

Answer:

Hertz are commonly expressed in multiples: kilohertz (103 Hz, kHz), megahertz (106 Hz, MHz), gigahertz (109 Hz, GHz), terahertz (1012 Hz, THz), petahertz (1015 Hz, PHz), exahertz (1018 Hz, EHz), and zettahertz (1021 Hz, ZHz).

8 0
3 years ago
Other questions:
  • When you right-click a spreadsheet object, what command should you select to activate the sheet?
    6·2 answers
  • A computer is a(n) ____ device, operating under the control of instructions stored in its own memory, that can accept data, proc
    9·1 answer
  • In "Brer Rabbit Gets Brer Fox's Dinner," what is Brer Fox busy doing?
    10·2 answers
  • In the context of the planning phase of the systems development life cycle (SDLC), which is an example of an internally identifi
    6·1 answer
  • Units for measuring computer memory
    5·1 answer
  • PLEASE HELP ASAP!!
    6·2 answers
  • Add criteria to this query to return records where the student lastname field begins with the letter
    13·1 answer
  • Using complete sentences post a detailed response to the following.
    15·1 answer
  • Help pleaseeeeeeeeeeeeeeeeee
    7·1 answer
  • Different between I time and E time​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!