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
mojhsa [17]
3 years ago
10

Write the definition of a method named printPowerOfTwoStars that receives a non-negative integer n and prints a string consistin

g of "2 to the n" asterisks. So, if the method received 4 it would print 2 to the 4 asterisks, that is, 16 asterisks: ����**************** and if it received 0 it would print 2 to the 0 (i.e. 1) asterisks:
Computers and Technology
1 answer:
defon3 years ago
8 0

Answer:

import java.io.*;

import java.util.*;

import java.lang.Math;

class GFG {

   public static void PowerOfTwoStars(int n){

       double a=Math.pow(2,n); //calculating the power..

       for (int i=1;i<=a;i++)//looping to print the stars.

       {

           System.out.print("*");

       }

   }

public static void main (String[] args) {

    Scanner star=new Scanner(System.in);//creating the scanner class object.

    int n=star.nextInt();//taking input.

    PowerOfTwoStars(n);//calling the function.

}

}

Input:-

3

Output:-

********

Explanation:

In the method PowerOfTwoStars which contains one argument I have calculated the power that is 2 to the n.Then looping form 1 to power and printing the stars and for better explanation please refer the comments the code.

You might be interested in
Which of these can be represented visually by a flowchart?
Mariana [72]

Answer:

i think its C.

if its wrong i'm truly sorry

Explanation:

4 0
3 years ago
Read 2 more answers
A new company starts up but does not have a lot of revenue for the first year. Installing anti-virus software for all the compan
Feliz [49]

WAN domain which stands for Wide Area Network and consists of the Internet and semi-private lines. The <span>RISKS are: Service provider can have a major network outage, Server can receive a DOS or DDOS attack</span> and A FTP server can allow anonymously uploaded illegal software.





7 0
3 years ago
Yan wants to attract customers specifically searching on Google for Time-B-Gone, his company's unique office-support product. Hi
Alecsey [184]

Answer:

The answer is "Option A".

Explanation:

The dynamic search ads also known as interactive contextual ads, that utilizes google advanced website browsing technologies to dynamically address relevant results requests based on the quality of a chain's website. These ads are beneficial for strategies, and other choices were wrong which can be described as follows:

  • In option B, It helps to upload all the dynamic search ads URLs quickly.
  • In option C, It helps to control computer service.
  • In option D, It increases the network traffic.
6 0
3 years ago
All of the following are examples of software, except:
Bezzdna [24]
Speakers is your answer
7 0
3 years ago
Read 2 more answers
When correctly implemented, what is the only cryptosystem known to be unbreakable?
Leona [35]

When accurately executed, the only cryptosystem known to be unbreakable is called: "One-time Pad" (Option D)

<h3>What is a Crypto System?</h3>

The one-time pad is a cryptographic approach that cannot be broken but needs the usage of a single-use pre-shared key that is not less than the message being delivered. A plaintext is coupled with a unique secret key in this manner.

It should be emphasized that in cryptography, a cryptosystem is a collection of cryptographic algorithms that are required to perform a certain security function, such as confidentiality. A cryptosystem is often composed of three algorithms: one just for key generation, one for encrypting, and one for deciphering.

Learn more about Crypto System:
brainly.com/question/15084188
#SPJ1

Full Question:

When correctly implemented, what is the only cryptosystem known to be unbreakable?

A) Transposition cipher

B) Substitution cipher

C) Advanced Encryption Standard

D) One-time Pad

6 0
1 year ago
Other questions:
  • A slide ____ is a special effect used to progress from one slide to the next slide in a slide show.
    12·2 answers
  • Which one of the following terms is defined as the material and surfaces upon which an artist works?
    9·1 answer
  • According to ________ law, in a sealed chamber, the pressure and temperature of a gas are directly related to each other.
    10·1 answer
  • HELP PLEASE NOW ASAP BRAINLIEST
    13·2 answers
  • Does Windows 7 support secure boot in UEFI? Windows eight? Linux UBUNTU version 14?
    8·1 answer
  • What is the difference between an electronic notebook and electronic flash cards?
    8·1 answer
  • Helpppp plsssss!!!<br><br>thanks.
    7·1 answer
  • Pls awnser if awnser is wrong I will unmark brainliest
    5·1 answer
  • (True or False) The speed at which data travels on a bus is referred to as the word size.
    6·2 answers
  • Both IT professionals and governments must apply ethical principles to certify that emerging technologies are to society.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!