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
A powerpoint ________ is a set of unified design elements.
natka813 [3]
<span>Within the elements of design, the set of elements of unified designs among them is called corporate because they create unity of identities of elements forming a set of equality of profiles and identities. Corporate is associated and collective to form equal elements and create a unit in the design.</span>
7 0
3 years ago
Question 1 :George, a user, is having trouble connecting to network resources, including shared folders on the local network and
vazorg [7]

Complete Question:

George, a user, is having trouble connecting to network resources, including shared folders on the local network and Internet resources. Yesterday he was able to connect with no problems. You need to ensure that he can connect to these resources. Which tool should you use FIRST?

Group of answer choices

A. ipconfig

B. Device Manager

C. My Network Places

D. Control Panel

Answer:

A. ipconfig

Explanation:

As a network administrator, to ensure that George can connect to the network resources, shared folders, and internet resources, the tool you should use first is the "ipconfig" in the command line. This is a troubleshooting process that would help to identify the problem and to establish a theory of probable cause.

<em>Since George could connect the previous day without any problem, it is most likely that the TCP/IP settings has been altered. Therefore, to view this settings you'll have to use an ipconfig command. </em>

4 0
3 years ago
How many times should the start function be defined in a program?
tatyana61 [14]

Answer:

0 1 2 However many you like

✓ I think its 2x they will start to define the program

4 0
3 years ago
5. How is shutter speed generally measured? What do the measurements mean?
Leokris [45]
Shutter speed<span> is </span>generally measured<span> by the scientific symbol “s”. The </span>measurement means<span> that the </span>measurements<span> in "s" is the reciprocal of the number when the denominator is put on the numerator side instead. ... Aperture is </span>measured<span> by f's.</span>
6 0
3 years ago
Read 2 more answers
Rob used Track Changes to suggest changes in Jack's document. Jack agrees with some edits and disagrees with others. What should
Kamila [148]

Answer:

B.   Click the Next icon on the Reviewing toolbar to review and then accept or reject each edit.

Explanation:

Since Jack wants to keep some changes and reject others, he can't use  a global solution (like presented in answers A and C).

He has to go through each and every change proposition and decide individually if he wants to keep the change or not.  That's why it's answer B.

It's the only way to accept some, reject some.  

At the end of this process, he'll have a clean document with Rob's recommendations and his original documents.

3 0
3 years ago
Other questions:
  • What types of scientific claims should be verified
    5·1 answer
  • What action makes RAM on your computer disappear?
    12·2 answers
  • Describe three main types of testing and the order in which they are performed.
    9·2 answers
  • What are the coordinates of (3 comma space 8 )relative to the basis open curly brackets space (1 comma space 1 )comma space (0 c
    15·1 answer
  • GIVING BRAINLIEST Jenna creates advertisements for companies to air on television. Which file format will best preserve the grap
    5·2 answers
  • Application of computer in insurance​
    14·1 answer
  • What is the name of the process of checking the client's production environment to ensure software and hardware compatibility wi
    5·2 answers
  • Cual
    5·1 answer
  • Which of the following statements is/are correct? a. At the network layer, entitlement can map identity and/or attributes to fun
    8·1 answer
  • Type of cable installed on a patch panel?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!