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
When reading a ____ language, we use our understanding of the richness of the language's vocabulary to extract the meaning. geop
USPshnik [31]
When reading a FORMAL language
4 0
3 years ago
Meta is a penetration testing engineer assigned to pen test the security firm's network. So far, she cannot tunnel through the n
Arte-miy333 [17]

In order to gain repeated and long-term access to the network system in the future, Meta should perform privilege escalation.

A penetration test is also referred to as pen test or ethical hacking and it can be defined as a cybersecurity technique that simulates a cyber attack against a user's computer system, in order to identify, test and check for exploitable vulnerabilities in the following:

  • Web software
  • Host device
  • Network

Hence, a pen test avails an end user the ability to exploit a weakness and potential security threats during vulnerability assessments of the system.

In Cybersecurity, privilege escalation can be defined as a process that involves the exploitation of a design flaw, software bug or configuration setting in a network, so as to gain repeated and long-term (elevated) access to the network or software application in the future. Thus, Meta should perform privilege escalation to enable her gain repeated and long-term access to the network system in the future.

Read more: brainly.com/question/24112967

7 0
2 years ago
Good Morning! Please Help!
vova2212 [387]

Answer:

cyber bullying

rights

technology

speech

education

study

issues

Explanation:

4 0
3 years ago
Match these step-by-step directions in the order that you will find them in this course.
7nadin3 [17]

Answer:

1.Go to the View tab and select Watch.

2.Comparison

3.Editing

4.Drawing (I think)

5.Predesigned slides available for creating a new presentation

Explanation:

6 0
3 years ago
If you created a variable called name, what data type would that value be? Group of answer choices a float a string a Boolean an
Semenov [28]

I think its an integer

8 0
2 years ago
Read 2 more answers
Other questions:
  • Explain how Deep Packet Inspection works (DPI). How is this technology beneficial to Perimeter Security? Lastly, describe a scen
    6·1 answer
  • The set of communications rules for exchanging information electronically on the internet is called the ________.
    10·1 answer
  • The Springfork Amateur Golf Club has a tournament every weekend. The club president
    7·1 answer
  • Is there a relationship between cybercrime and traditional crime?
    6·1 answer
  • Assume that x and y are boolean variables and have been properly initialized. !(x || y) || (x || y) The result of evaluating the
    10·1 answer
  • Which online note-taking device allows students to clip a page from a website and reuse it later?
    13·2 answers
  • Define the terms network, LAN, WAN, and Internet.
    11·1 answer
  • Look at the picture ​
    13·2 answers
  • Area Triangolo Rettangolo in c++
    6·1 answer
  • you want to upgrade your windows 10 professional computer to windows 11 professional. you begin by checking the hardware and dis
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!