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
natta225 [31]
3 years ago
12

Write a method starString that accepts an integer parameter n and returns a string of stars (asterisks) 2n long (i.e., 2 to the

nth power).
Computers and Technology
1 answer:
lys-0071 [83]3 years ago
4 0

Answer:

public class Main

{

public static void main(String[] args) {

 System.out.println(starString(4));

}

public static String starString(int n){

    double p = Math.pow(2,n);

    String s = "";

    for(int i=0; i<p; i++)

        s += "*";

       

   return s;

}

}

Explanation:

Create a method named starString that takes an integer parameter, n

Get the 2 to the nth power using pow method and set it to the p

Create an empty string that will hold the asterisks

Create a for loop that will iterate p times. Inside the loop, concatenate an asterisk to the s

Return the s

Inside the main method, call the method with an integer parameter

You might be interested in
Why is dark supereffective against ghost?
Mice21 [21]

Answer:

hmmmmm...hold up let me look up what dark supereffective means XD...

Explanation:

?oh so i only see stuff about pokemon so id imagine its about that...

4 0
3 years ago
Read 2 more answers
An air-conditioning system's automatic controller might directly control the
yaroslaw [1]
Control the temperature of the system and as well as how long the system will run
5 0
3 years ago
Read 2 more answers
❤️❤️❤️❤️❤️❤️❤️❤️IS THERE ANYONE'S STILL AWAKE?? HMM HEHE I'M HERE AGAIN~~~ FOLLOW ME FOR MOR3~~​
insens350 [35]

Answer:

hello?

Explanation:

3 0
2 years ago
Read 2 more answers
A(n) ________ collects data from various key business processes and stores the data in a single comprehensive data repository, u
xxTIMURxx [149]

Answer:

An Enterprise System

Explanation:

An enterprise system also refered to as an enterprise software is a computer software application used to handle the needs of a business or an enterprise examples are schools, production companies, government ministries and departments, charities etc.

The software provides all the business oriented services for the enterprise, services such as payment processing, students' information management, automated billing and payments etc.

Because enterprises will typically have different departments, the software is able to collect data from all the key business processes across all the departments into a single database which is useable according to different access privilages by all other parts of the enterprise.

3 0
2 years ago
13,Which hardware device is used in decoding the machine language version of an instruction in the Instruction Decode stage of t
Julli [10]
It should be the control unit
8 0
1 year ago
Other questions:
  • Sarah's research shows that business information management professionals also perform the duties of other professionals. Which
    9·1 answer
  • RADIAC instruments that operate on the ionization principle are broken down into three main categories based on what?
    15·1 answer
  • How many bits are required to address a 1mx8 main memory if main memory is byte addressable?
    6·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • Read the section, "Junior Year." Why would someone chose to complete an apprenticeship after high school? How many occupations c
    14·2 answers
  • A powerboat is about to cross paths with a sailboat under sail. What should the powerboat do
    5·1 answer
  • Sum of 18/7 and 13/7 is *​
    14·2 answers
  • The Uniform Electronic Transmission Act (UETA) a. declares that e-signatures are invalid. b. has only been adopted in a handful
    8·1 answer
  • After selecting the Slide Master tab (within the View tab), which actions can a user take to configure a slide master?
    8·1 answer
  • Information to develop a project network is collected from the.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!