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
mariarad [96]
3 years ago
6

1) Declare an ArrayList named numberList that stores objects of Integer type. Write a loop to assign first 11 elements values: 1

, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. Do not use Math.pow method. Assign first element value 1. Determine each next element from the previous one in the number List. Print number List by using for-each loop.
Computers and Technology
1 answer:
Ymorist [56]3 years ago
3 0

Answer:

Explanation:

The following is written in Java and uses a for loop to add 10 elements to the ArrayList since the first element is manually added as 1. Then it calculates each element by multiplying the previous element (saved in count) by 2. The program works perfectly and without bugs. A test output can be seen in the attached image below.

import java.util.ArrayList;

class Brainly {

   public static void main(String[] args) {

       ArrayList<Integer> numberList = new ArrayList<>();

       numberList.add(0, 1);

       int count = 1;

       for (int i = 1; i < 11; i++) {

           numberList.add(i, (count * 2));

           count = count * 2;

       }

       for (Integer i : numberList) {

           System.out.println(i);

       }

   }

}

You might be interested in
A deleted file or folder is not permanently deleted from a computer until which event occurs?
Dimas [21]

Answer:

The computer is restarted. The Recycle Bin or Trash is emptied

Explanation:

8 0
3 years ago
NumA=2<br> for count range (5,8)<br> numA=numA+count <br> print(numA)
love history [14]

Answer:

for count in range (5,8): numA=numA+count print(numA)

Explanation:

7 0
3 years ago
How do you create a table in an existing database on Microsoft Access?
earnstyle [38]
Hello! In order to make a table in an existing database, first, you need to open the database you want to open, and then on the create tab, go on the tables group and click table. A table will be inserted into the database and you will be able to see it in datasheet view. That will help you make the table and be able to edit as needed.

8 0
4 years ago
Read 2 more answers
Macronutrients include carbon, phosphorous, oxygen, sulfur, hydrogen, nitrogen and zinc. (T/F)
kvv77 [185]

Answer:

The answer to your question is False

Explanation:

Macronutrients are complex organic molecules, these molecules give energy to the body, promote the growing and the good regulation of the body. Examples of macromolecules are Proteins, carbohydrates, and Lipids.

Micronutrients are substances that do not give energy to the body but they are essential for the correct functioning of the body. Examples of micronutrients are Vitamins and Minerals.

3 0
4 years ago
25 Points!
neonofarm [45]

Answer:

I believe the answer is D. var = var + 1

Explanation:

5 0
3 years ago
Other questions:
  • Marcus just created a new folder specifically for his buisness records so he would like to move last months business transaction
    13·2 answers
  • Your company has recently been hired to install a smart security system for a large office building. The system will include sec
    12·1 answer
  • How can i take out a random (double) number in between 5.0 to 15.0 in c++?
    7·1 answer
  • Which of the following describes the term "false information?"
    5·1 answer
  • What would be a reason for using a workstation rather than a personal computer?
    7·1 answer
  • Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the t
    10·1 answer
  • Create a macro named mReadInt that reads a 16- or 32-bit signed integer from standard input and returns the value in an argument
    5·1 answer
  • 1 point
    5·2 answers
  • How do you code to find the surface area 6 s2, volume s3 in python
    6·1 answer
  • If a company uses multimedia applications in addition to normal file and database sharing, which transmission is more efficient?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!