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
Which best describes TPM?
rodikova [14]

Answer:

Encryption used on hard drives

Explanation:

TPM is a hardware chip. It is a type of module that is used to authenticate the hardware devices with the help of encryption keys (passwords). It is the short form of Trusted Platform module. The hardware devices that be authenticated through this module may include personnel computer or laptops. There are different keys, password and security codes.

So, the best sentence that describes, TPM is Encryption built into hardware .

4 0
3 years ago
How do you strike through text in excel?
Valentin [98]
In the font options there is a checkbox for strikethrough. Same dialog as word, only there is no button in the ribbon for it. You could customize that by creating a custom group if you want to.
6 0
4 years ago
Mary is employed by a multinational firm, and works lon hours on a desktop computer. Recently, she experienced back pain and vis
iVinArrow [24]
Sit with good posture, get up and stretch and walk for 1 minute every 45 minutes.
6 0
3 years ago
Read 2 more answers
Consider a situation where we have a file shared between many people.  If one of the people tries editing the file, no other pe
Sergeu [11.5K]

Explanation:

I am a collection of this process from Trash on the computer system and the program that included a new twist on the computer and the skin that appears after loading and the Windows operating system it was much that appear on identifying long horizontal bar at the bottom of the screen and water pollution and its control car parts of the computer with enough letters and adware if for the collection of the fat calculation in the complete committee that in the water method is a product of a screensaver been disciplined displayed at the subject of the right click an icon To Number Sau new file getting opened on you can getting opened on a forgiving of an operational effectiveness of the program is a false false false

7 0
3 years ago
Where would you go to change the macro settings in a Word document? Click the File tab and open Protection. Click the File tab a
yawa3891 [41]

Answer:

Click the File tab, select Options, and open the Trust Center.

Explanation:

7 0
3 years ago
Other questions:
  • Lance is at a bus station. His friend is using the ATM machine to withdraw some money. Lance notices a stranger deceptively watc
    6·2 answers
  • When would you use conditional formatting on a cell?
    9·1 answer
  • 7.12 LAB: Contains the character
    12·2 answers
  • does someone know of a website where I can find free essays or assignments already answered (right or wrong, ain't matter), kind
    15·1 answer
  • How many check boxes from the following code can be selected at any given time? Home Address Federal Express UPS
    13·1 answer
  • Describe the purpose of functional dependency in computer science.<br>​
    13·1 answer
  • Suppose that L is a sorted list of 1,000,000 elements. To determine whether the x item is in L, the average number of comparison
    14·1 answer
  • There are main type of memory
    7·1 answer
  • Wassup anybody tryna play 2k
    6·2 answers
  • The retention of encoded information over time refers to
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!