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

For java

Computers and Technology
1 answer:
Sedbober [7]3 years ago
8 0

Answer:

public class array{

    public static void main(String []args){

       int[] array = {2,4,7,1,9};

       int num_vals = array.length;

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

           

           System.out.println(array[i] + " ");

       }

       for(int i=num_vals-1;i>=0;i--){

           

           System.out.println(array[i] + " ");

       }

    }

}

Explanation:

First create the class in the java programming.

Then create the main function and declare the array with values.

Store the size of array in num_vals variable by using the function array.length.

create a for loop to iterate the each element in the array and then print on the screen with spaces and newline.

it traverse the loop from first to last.

Then, again create the for loop to iterate the each element in the array and then print on the screen with spaces and newline but the traversing start from last to first.

You might be interested in
Which soft skill involves the ability to work harmoniously with your colleagues and improve productivity?
Lina20 [59]
B.Teamwork is a soft skill involves the ability to work harmoniously with your colleagues and improve productivity. It is the collaborative effort of a team to complete a task or to achieve a common goal in the most effective and efficient way.  

 


4 0
3 years ago
Given the code as follows: main() { int i = 3, n; float x; x = i; n = 8 % x; } What problem will occur? Group of answer choices
Bess [88]

Answer:

A compilation error will occur.

Explanation:

The % operator does not accept a float as its right-hand operand.

7 0
3 years ago
Select the correct answer.
konstantin123 [22]
Hello!

Similar to the keyboard character keys F and J, the number 5 on the numeric keypad has a bump on it.

This is to also help position your fingers on the keypad when typing numbers.

Hope this helps!
5 0
2 years ago
In the following four questions, we are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the pa
pantera1 [17]

Answer:

1)we are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination have a transmission rate of 10 Mbps. Assume that the propagation speed is 2 * 108 meters/sec, and the distance between source and destination is 10,000 km. Initially suppose there is only one link between source and destination. Also suppose that the entire MP3 file is sent as one packet. The TRANSMISSION DELAY is:

3 Seconds

2)

we are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination have a transmission rate of 10 Mbps. Assume that the propagation speed is 2 * 108 meters/sec, and the distance between source and destination is 10,000 km. The END TO END DELAY(transmission delay plus propagation delay) is

3.05 seconds

3)

we are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination have a transmission rate of 10 Mbps. Assume that the propagation speed is 2 * 108 meters/sec, and the distance between source and destination is 10,000 km. how many bits will the source have transmitted when the first bit arrives at the destination.

500,000 bits

4)

we are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination have a transmission rate of 10 Mbps. Assume that the propagation speed is 2 * 108 meters/sec, and the distance between source and destination is 10,000 km. Now suppose there are two links between source and destination, with one router connecting the two links. Each link is 5,000 km long. Again suppose the MP3 file is sent as one packet. Suppose there is no congestion, so that the packet is transmitted onto the second link as soon as the router receives the entire packet. The end-to-end delay is

6.1 seconds

5)

we are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination have a transmission rate of 10 Mbps. Assume that the propagation speed is 2 * 108 meters/sec, and the distance between source and destination is 10,000 km. Now suppose that the MP3 file is broken into 3 packets, each of 10 Mbits. Ignore headers that may be added to these packets. Also ignore router processing delays. Assuming store and forward packet switching at the router, the total delay is

4.05 seconds

6)

we are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination have a transmission rate of 10 Mbps. Assume that the propagation speed is 2 * 108 meters/sec, and the distance between source and destination is 10,000 km. Now suppose there is only one link between source and destination, and there are 10 TDM channels in the link. The MP3 file is sent over one of the channels. The end-to-end delay is

30.05 seconds

7)

we are sending a 30 Mbit MP3 file from a source host to a destination host. All links in the path between source and destination have a transmission rate of 10 Mbps. Assume that the propagation speed is 2 * 108 meters/sec, and the distance between source and destination is 10,000 km. Now suppose there is only one link between source and destination, and there are 10 FDM channels in the link. The MP3 file is sent over one of the channels. The end-to-end delay is

30.05 seconds

6 0
3 years ago
On the following page, write a static method print Short Words that accepts two parameters:_____.
barxatty [35]

Methods in Java are collections of program statements that are named, and executed when called/invoked

The printShortWords method in Java where comments are used to explain each line is as follows:

//This defines the static method

public static void printShortWords(String str, int maxLength){

    //This iterates through each word in the string

    for(String word: str.split(" ")){

        //The compares the length of each word to maxLength

        if(word.length()<=maxLength){

            //If the length of the current word is atleast maxLength, the word is printed

        System.out.print(word+" ");

        }

    }

}

Read more about static methods at:

brainly.com/question/19360941

7 0
2 years ago
Other questions:
  • Which options correctly describe Andrew's job role?
    6·1 answer
  • What are some good job skills?
    12·1 answer
  • you are the manager of a virtual team that is working on a project. You uploaded a Word document to an OneDrive account that you
    9·1 answer
  • The expressions in each part of an AND or OR expression use ________ evaluation; that is, they are evaluated only as much as nec
    9·1 answer
  • Can someone please help with one? I will mark brainlest!!!
    5·2 answers
  • Does the estimate of a tolerance level of 68.26% of all patient waiting times provide evidence that at least two-thirds of all p
    13·1 answer
  • Write a program that has the user input how many classes they are taking this semester and then output how many hours they will
    8·2 answers
  • You are creating a story map about Mexico. After configuring the web app template, you launch the app to test it. When the app o
    13·1 answer
  • The purpose of __________________ is to isolate the behavior of a given component of software. It is an excellent tool for softw
    13·1 answer
  • Consider the following correct implementation of the selection sort algorithm.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!