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
sasho [114]
3 years ago
5

Write a program that creates an integer array with 40 elements in it. Use a for loop to assign values to each element of the arr

ay so that each element has a value that is triple its index. For example, the element with index 0 should have a value of 0, the element with index 1 should have a value of 3, the element with index 2 should have a value of 6, and so on.
Computers and Technology
1 answer:
iogann1982 [59]3 years ago
8 0

Answer:

public class Main

{

public static void main(String[] args) {

 int[] numbers = new int[40];

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

     numbers[i] = i * 3;

 }

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

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

 }

}

}

Explanation:

*The code is in Java.

Initialize an integer array with size 40

Create a for loop that iterates 40 times. Inside the loop, set the number at index i as i*3

i = 0, numbers[0] = 0 * 3 = 0

i = 1, numbers[1] = 1 * 3 = 3

i = 2, numbers[2] = 2 * 3 = 6

.

.

i = 39, numbers[39] = 39 * 3 = 117

Create another for loop that iterates 40 times and prints the values in the numbers array

You might be interested in
Jesse purchases a new smartphone and is immediately able to use it to send a photo over the Internet to a friend who lives in a
frez [133]

Answer:

D: A single direct connection is established between any two devices connected to the Internet.

Explanation:

The internet is a complex network system made of protocols, packets, and other things. For a network to be connected, it requires the use of multiple pathways. It is unnecessary for a single direct connection because of most of the networks in this real-world travel in multiple direct connections. For example, if you want to go to Brainly.com. It first needs your IP address and then the protocols like HTTP and TCP to send it. Networks are just like traffic. If one section or a part gets blocked, they go on a different path and reach their destination. It is the same here for networks. Networks go into multiple directions to get to their destination. Therefore, a single direct connection is not required or necessary to make it possible.  

8 0
3 years ago
You browsing internet and you realize that its not responding what do you do with out rebooting the computer
Allisa [31]
You can try and turn wifi off then on press save on whatever you were doing if you can then reboot it. other then that theres not many more options.
4 0
3 years ago
How can u refer to additional information while giving a presentation
yawa3891 [41]

Answer:

There are various ways: Handing out papers/fliers to people, or presenting slides.

7 0
3 years ago
Use System.DateTime along with System.Console to implement a simple C# program that does the following:_______.
Andre45 [30]

Answer:

5

Explanation:

I did it to and it was right

3 0
2 years ago
Addition and subtraction are considered to be ____ operations performed by a computer.
Natali5045456 [20]

Answer:

Mathematical operations

4 0
3 years ago
Other questions:
  • The operation of the waste spark Ignition system is being discussed. technician a says that the spark that occurs on the exhaust
    14·1 answer
  • Direct connections provide continuous access to the Internet. Many bandwidth options are associated with direct connections. Whi
    9·1 answer
  • An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation
    9·1 answer
  • Type an SQL statement into the Record Source property of the report. The statement should select all fields (*) for employees wi
    5·1 answer
  • Robert's employer has agreed to pay half the tuition for Robert to complete his college degree. This benefit is known as what?
    7·2 answers
  • Suppose you're currently completing an examination online. When you're finished, you click on Reset Exam. Why would you do this?
    8·1 answer
  • Drag each tile to the correct box.
    9·1 answer
  • 2. A well designed high-volume system will minimize _________ inventory and reduce _____________for the product or service. a) w
    7·1 answer
  • ___ design uses the same webpage content, but applies styling depending on the viewport size of the device
    11·1 answer
  • In news writing, which is bigger , a topic or a angle
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!