BJP4 Exercise 3.2: printPowersOf2

How do you do this????

Answers

Answer 1

Answer:  Write a method called printPowersOf2 that accepts a maximum number as an argument and prints

* each power of 2 from 20 (1) up to that maximum power, inclusive.

*/

public static void printPowersOf2(int max) {

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

       System.out.print((int) Math.pow(2, i) + " ");

   }

   

   System.out.println();

Explanation:

Answer 2

I just looked your problem up and read the directions. Using java:

public class JavaApplication63 {

   public static void printPowersOf2(int maximum){

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

           int num = 1, w  = 0;

           if (i == 0){

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

           }

           else{

               while (w < i){

                   num *= 2;

                   w++;

               }

           }

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

       }

   }

   public static void main(String[] args) {

       printPowersOf2(8);

   }

   

}

In my code, we don't use the math class. I hope this helps!


Related Questions

How can we work together to fix our website

Answers

Answer:

you can upade the code  

make a off topic page

Explanation:

I thnk this will help with the spamers


The variable isopen is to be used to indicate whether or not a store is currently open. Which of the following is the most appropriate data type for isOpen?

Answers

Answer:

Boolean

Explanation:

Though the options are missing, the question is still answerable.

From the question, we understand that isOpen can only assume any of two values which are: open or close

i.e. whether a store is opened or currently.

When a variable can only assume any of two values, the most suitable data type of that variable is Boolean.

Hence, Boolean answers the question.

Three popular types of ____ are handheld computers, PDAs, smart phones.

Answers

Answer:

portable media players, and digital cameras

Explanation:

Three popular types of mobile devices are handheld computers, PDAs, and smart phones.

What are smart phones?

Smart phones can be defined as hybrid versions of mobile devices that are designed and developed to have more features, so as to enable them run different applications, functions and tasks with the aid of software applications such as web browsers, multimedia player, etc.

In Computer technology, three popular types of mobile devices are handheld computers, PDAs, and smart phones.

Read more on smart phones here: https://brainly.com/question/15867542

#SPJ2

Public-key cryptography (a form of asymmetric cryptography) is an encryption method that's widely used because: 1) it is computationally infeasible to computer the private key based on the public key, 2) it's easier to share one public key than billions of private keys, 3) it's much tough to crack asymmetric encryption than symmetric, 4) it's more secure because the private keys do not even need to be transmitted or revealed to anyone.

A. 1 only
B. 2 only
C. 3 and 4 only
D. All 1-4 are correct

Answers

Answer:

C.

Explanation:

Specific keys that each finger is responsible for typing is called A. ergonomics B. Touch typing C. Key reaches D. Posture

Answers

Answer:

D

if your key positioning and posture is right, each finger would be put up to use.

The extension on the end of a file name will tell you what format the file is.
O True
O False

Answers

The answer is true

The .whatever tells you what format the file is

The extension on the end of a file name will tell you what format the file is True statement.

What is a file file extension?

A file extension is known to be a kind of file name extension that is said to often ends with a file that one can be able to use to identify the type of file that exist in an operating systems.

Conclusively, due to the above, that is, the extension on the end of a file name will tell you what format the file and thus it is a true statement.

Learn more about extension from

https://brainly.com/question/10713675

#SPJ2

30% of the mass of an objects is 24 kilograms. use this fact to find:
a) 60% of the mass
b) 10% of the mass
c) 50% of the mass
d) the whole mass of the object​

Answers

Answer:

chemați. mfvd5. fn. cfcfcfcfcfcfcf 4t

What is a characteristic of high-level languages?

A.
They have the fastest execution speed on computer processors

B.
They use unfamiliar English words to describe instructions and memory locations.

C.
They expect programmers to be familiar with computer architecture.

D.
They use mathematical symbols such as “+” and “-” to denote addition and subtraction operations.

Answers

Answer:

B SIR HOPE THIS HELPS (☞゚ヮ゚)☞☜(゚ヮ゚☜)

Explanation:

Answer:

B is not the answer on plato

you can fit more RAW files on a memory card than JPEG files. true or false

Answers

Answer:

true

Explanation:

which network topology is the cheapest?

Answers

The star and extended star are inexpensive

Write a program to simulate a Fruit Machine that displays three symbols at random from Cherry, Bell, Lemon, Orange, Star, Skull.
The player starts with £1 credit, with each go costing 20p. If the Fruit Machine “rolls” two of the same symbol, the user wins 50p. The player wins £1 for three of the same and £5 for 3 Bells. The player loses £1 if two skulls are rolled and all of his/her money if three skulls are rolled. The player can choose to quit with the winnings after each roll or keep playing until there is no money left.

1. Write pseudo or flowchart for this task ready for it to be coded in class tomorrow - 1/12/2020
2. needs - variable, iteration - while because of some condition, selection - it's all the IFs, Sequence - be careful of sequence


please this is urgent i beg u

Answers

Answer:

please read these terms and search for Google app

please answer i will give you brainelst!!!!!!!!!!

Answers

Answer:

I think it's D

Explanation:

Hope you don't get it wrong

Read the following scenario, and then answer the question below.

Two of the computers at work can't go online and print over the network. The computers may be trying to share the same IP address.

Which strategy is most likely to solve the problem?​

Answers

Answer:

I think they need to get different up adresses

Explanation:

They may be overloading the network if they are sharing an IP address so it doesn’t k ow what to print

Answer:

the best way is to logging off one of the computers, and then logging back on.

have a nice day.

A taxi cab costs $1.25 for the first mile and $0.25 for each additional mile. Write an
equation for the total cost of a taxi ride, where x is the number of miles that you can ride for
$8.00.

Answers

Answer:

0.25x+1.25=8

Explanation:

Hope this helps

please help i will give you brainlest!!!!!!!!!

Answers

Answer:

Letter C

Plagiarism is copying someone's work or stealing other original ideas.

what is a Java software​

Answers

Answer:Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment.

also: 'Java can be used to create complete applications that may run on a single computer or be distributed among servers and clients in a network. It can also be used to build a small application module or applet (a simply designed, small application) for use as part of a Web page.

Explanation:

what is data modelling​

Answers

Answer:

Data modeling is a process used to define and analyze data requirements needed to support the business processes within the scope of corresponding information systems in organizations. Data modeling defines not just data elements, but also their structures and the relationships between them.

Explanation:

there ya go.

Data modeling is when you create information for a data model system. Sometimes, this data model is usually implemented into a database, which then results in database modeling

Data is best described as

statistical details.
factual or numerical information.
calculations and conclusions.
multimedia content.

Answers

Answer:

The answer is B

Explanation:

TOOK THE TEST

Answer:

B: factual or numerical information.

Explanation:

Edge 2020

Is there a way to using Microsoft apps for iOS?

Answers

Answer:

nope there is no way ut some games or apps is also can download in ios and also in microsoft

Which of these are examples of data sources? Check all that apply.
-central processing units
-databases
-electronic archives
-folders
-online libraries
-spreadsheets

Answers

Example of data sources include the following:

Online libraries

Spreadsheets

What is sources of data?

Sources of data is the main or primary location from where data is being obtained.

For computer programs, the main sources of data include:

File,

Data sheet,

Spreadsheet,

Online libraries

Therefore, examples of data sources are the online libraries and spreadsheets.

Learn more about data here:

https://brainly.com/question/25720881

#SPJ2

Answer:

B,C,E,F

Explanation:

What is the shape of a CARDIOD pick up pattern?

Answers

ayoooooo? its shaped like a butt

In your own words explain the following about the Domain Name System
What problem does the DNS solve?
How does the DNS help the world wide web scale so that billions of users can access billions of web pages?

Answers

Answer:

Suppose you want to access brainly.com.  You type that into your favorite browser and hit enter.  Your computer does not know how to get to brainly.com.  This is the DNS comes in.  The DNS looks for brainly.com and maps it to an IP address (eg. 104.17.74.91).  Your computer can easily find 104.17.74.91 in order to connect you to questions and answers on a variety of topics.

any one want to play freefire with me and my duo​

Answers

Answer:

hahahaha you thought

Explanation:

Which is a benefit of peer-to-peer networking?

Answers

Answer:

Easy file sharing: An advanced P2P network can share files quickly over large distances. Reduced costs: There is no need to invest in a separate computer for a server when setting up a P2P network. Adaptability: P2P network extends to include new clients easily.

Maria wants to create an image for a Web page. Maria should use _____. help me

Answers

graphics software
Hope it helps

Answer:

Maria wants to create an image for a Web page. Maria should use a graphics software

Explanation:

A graphics software is a tool to create images, logos and graphics. Graphic software provide different options to make and edit an image. So if someone has to create an image, he/she should use a graphic software.

Hence,

Maria wants to create an image for a Web page. Maria should use a graphics software

Ask the user for their full name (using a single input), write a section of code below that will correctly print the users first name and last name on separate lines.

Answers

name = input("Enter your name: ")

lst = name.split()

print(lst[0])

print(lst[1])

We split the name apart at the spaces and print out the object at index 0, which is the first name and at index 1, which is the last name.

I hope this helps!

Write a Python program that calculates the product of all odd numbers between 1 and 1111, using the for loop and the range function.

Answers

Answer:

answer = 1

for i in range(1, 1111, 2):

   answer *= i

print(answer)

Explanation:

The result is: 1867661487583158519937007997593731768674710592395936453814589179168970488627486922435352153202170177468180449036460330489883227953920786805094193880129176242750706494757506292242513096874889912138041641434433821228611320718319399459865627764413363015842622109227229695987391658459583021203370153652674793604946843921588657975214048903891877905278158326695472816452229608456097609116519045810867129060580585147954461081838126748579250596173066031868654116793938302170110362754673884690241925481893823673916009076351110558645412222773118927086453253674705050538434792606852567079575854841390964177213252754015145265445261542957834970632574543428225247242488955307645556148572185949820791464992259236192606284766174288372574869081003838416637821295590820946372288692264397746175279884156247638880688731656093911498376399334121390341627286952705811600644061948275361728751637451512725082376969150560038940786375629981515779279396085386198351152320090978588430101676704229895114350886499131456005886390334346220238579530541662198038029084029447261270224035584412162390327122500762501298502491940263477106501424307313102108306951120296510397274150253596249878157904612419169854362011297315737418348969961989528582716326033338095891309343771263480361729925724962879195879868448756011080612327885089033870698092857432512937836751109257833022671357201287794589267907954829015862301288301132960212133783812669550047024479011437136932727298699319362640380859375

What is iteration?????

Answers

Answer:

Iteration is a program repeated untill a condition is met

Explanation:

Explanation:

Iteration in programming means repeating steps, or instructions, over and over again. This is often called a ‘loop’.

Iteration is the repetition of a sequence.

Algorithms consist of instructions that are carried out (performed) one after another. Sometimes an algorithm needs to repeat certain steps until told to stop or until a particular condition has been met.

what is the easiest way not to get distracted from doing my school work?

Answers

Answer:

really you want the answer

Answer:

Find a good quiet place, Turn off your phone. put it away, wear comfy clothes, Lock your door. Dont eat, But drink water

Explanation:

Hope this helped!

Anna always has a hard time finding files on her computer because she does not know where she saved them. This also affects her productivity at work. Anna is lacking good skills.

Answers

Answer:

Organization skill

Explanation:

THIS IS THE COMPLETE QUESTION

Anna always has a hard time finding files on her computer because she does not know where she saved them. This also affects her productivity at work. Anna is lacking good ______ skills.

From the question we are informed about Anna always who has a hard time finding files on her computer because she does not know where she saved them. This also affects her productivity at work. In this case, the skill she is lacking is file management skills. File management skills is a skill that is required in the setting up system that effectively handle digital data. File management gives enablement to search data in searchable database which allows the user to find data easily on the computer. Some of the advantages of file management are:

reduce storage space,better back up system, easier retrieval of file, as well as file security.

Answer:

She is lacking good Organization skills.

Explanation:

Other Questions
A block is at rest. The coefficients of static and kinetic friction are s = 0.81 and k = 0.69, respectively. The acceleration of gravity is 9.8 m/s^2.Required:a. What is the largest angle which the incline can have so that the mass does not slide down the incline?b. What is the acceleration of the block down the incline if the angle of the incline is 44? Solve an equation. 24 kg = ___ g How do you write 1 as a percentage? 5 Is the word (explained) a action-linking or helping verb?Someone please help things that cause stress are called? What were the 5 causes of the American Revolution? What bureaucratic challenges has the Department of Homeland Security been forced to confront, and what challenges does it continue to confront? Do you think the department's organizational structure has enabled it to fulfill its mission? Why or why not? Explain why helium (He) is stable (unreactive), but hydrogen (H) is unstable (reactive) x = [?]3x + 18 4x + 15Hint: When angles form a linear pair, their sum is 180.3x + 18 + 4x + 15 = 180 ANNIE: Mr. Anagnos.(Her voice is trembling.)Dear Mr. Anagnos, I(But she swallows over getting the ring on her finger, and cannot continue until she finds a woebegone joke.)Well, what should I say, Im an ignorant opinionated girl, and everything I am I owe to you?ANAGNOS [SMILES]: That is only half true, Annie.ANNIE: Which half? . . . This place gave me more than my eyes back. Or taught me how to spell, which Ill never learn anyway, but with all the fights and the trouble Ive been here it taught me what help is, and how to live again, and I dont want to say goodbye. Dont open the door, Im crying.ANAGNOS [GENTLY]: They will not see.Which tone would be most appropriate for a text trailer that includes this scene?playfulformalsorrowfulmysteriousANNIE: Mr. Anagnos.(Her voice is trembling.)Dear Mr. Anagnos, I(But she swallows over getting the ring on her finger, and cannot continue until she finds a woebegone joke.)Well, what should I say, Im an ignorant opinionated girl, and everything I am I owe to you?ANAGNOS [SMILES]: That is only half true, Annie.ANNIE: Which half? . . . This place gave me more than my eyes back. Or taught me how to spell, which Ill never learn anyway, but with all the fights and the trouble Ive been here it taught me what help is, and how to live again, and I dont want to say goodbye. Dont open the door, Im crying.ANAGNOS [GENTLY]: They will not see.Which tone would be most appropriate for a text trailer that includes this scene?playfulformalsorrowfulmysteriousANNIE: Mr. Anagnos.(Her voice is trembling.)Dear Mr. Anagnos, I(But she swallows over getting the ring on her finger, and cannot continue until she finds a woebegone joke.)Well, what should I say, Im an ignorant opinionated girl, and everything I am I owe to you?ANAGNOS [SMILES]: That is only half true, Annie.ANNIE: Which half? . . . This place gave me more than my eyes back. Or taught me how to spell, which Ill never learn anyway, but with all the fights and the trouble Ive been here it taught me what help is, and how to live again, and I dont want to say goodbye. Dont open the door, Im crying.ANAGNOS [GENTLY]: They will not see.Which tone would be most appropriate for a text trailer that includes this scene?playfulformalsorrowfulmysterious Where was she from?O Nicaraguao Costa RicaGuatemalaOOo ColombiaAnswer is Guatemala Who was the youngest person to win Nobel peace prize answer is Rigoberto Manchu Tum f (x)=2x-1 Find f (-2) The sum of three consecutive integers is 72 For today I need the equation please Many natural ecosystems have been destroyed by human activity. To better manage our remaining natural ecosystems, we must first understand how the ecosystems are structured. One way to do this is to determine how the organisms in the ecosystem obtain the matter and energy they need to survive. The figure below shows a simplified food web. Use the figure to answer the following questions.Which of the following correctly shows one pathway for the flow of energy to an owl? A. owls squirrels foxes B. green plants mice squirrels C. owls green plants mice D. green plants squirrels owls 30 pointssssss!!!! HELPPThe functionf(x)=3x+4 is a linear function. Let g(x) represent f(x) after a horizontal translation 2 units to the left. What is the equation for the function g(x)? One of the challenges that all photographers face is creating a great photograph. arrange the events of mitosis 1 of the animal cell in the correct order how do we do this pls help with an explanation:)) PLEASE PLEASE HELP I WILL GIVE BRAINALISTwhat points do i graph and what is the slope? 2x-9y=8 -5x+8y=20 find x and y