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
The set of instructions that directs the computer to perform a variety of tasks is known as a
Vilka [71]
Answer: software (answer not long enough)
5 0
3 years ago
You are an IT technician for your company. One of your employees has a computer that continually reboots when it is powered on.
Elan Coil [88]

Answer:

D: Use a multimeter to test the power supply

Explanation:

We want to determine whether the power supply is causing the reboots. Now, the most ideal thing to do will be to connect a multimeter to help in testing the source of power supply. This is because a multimeter measures the major factors in power which are voltage, current and resistance and as such it is therefore a standard diagnostic tool used widely by technicians in the electrical & electronic industries.

5 0
3 years ago
A. experiment by purposely misconfiguring the gateway address on pc-a to 10.0.0.1. what happens when you try and ping from pc-b
MrRa [10]
Yes you will mate, hope this helps!
7 0
3 years ago
Database administrators must make sure that ________ and ________ techniques and procedures are operating to protect the databas
butalik [34]

Answer:

backup; recovery

Explanation:

Backup and recovery refers to the process of backing up data in case of a loss and setting up systems that allow that data recovery due to data loss. Backing up data requires copying and archiving computer data, so that it is accessible in case of data deletion or corruption. Data from an earlier time may only be recovered if it has been backed up.

Data backup is a form of disaster recovery and should be part of any disaster recovery plan.In some cases, backing up or restoring entire systems, or the enterprise, after an event or disaster can take days

5 0
4 years ago
What is the value of |-10|
Goshia [24]
Its 10, value always has to be positive.
6 0
3 years ago
Other questions:
  • The term ________ refers to the use of a single unifying device that handles media, Internet, entertainment, and telephone needs
    7·1 answer
  • How does scarcity affect what gets produced
    5·1 answer
  • Your team will write a function that reverses a C-string, to practice using pointers. You must use pointers and C-strings for th
    6·1 answer
  • A) Suppose a computer has an instruction pipeline with 4 phases. How many cycles (if there are no delays) would it take to compl
    13·1 answer
  • E-mail messages, instant messages (IMs), or text messages sent and/or received within an organization a. are not included on a r
    9·1 answer
  • The physical parts or components of a computer system is called?
    8·2 answers
  • The right to make others do things is referred to as _________.
    14·2 answers
  • Explain the three schemes via which the binding of instructions and data to memory addresses can be done. In each scheme, how th
    13·1 answer
  • Explain why this scenario could put an organization in jeopardy of losing some of its workforce.
    12·1 answer
  • Blockquote
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!