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
You are configuring a wireless network with two wireless access points. Both access points connect to the same wired network. Yo
-BARSIC- [3]

Answer:

b. Same SSID, different channel

Explanation:

The Service Set Identifier (SSID) is a sequence that is included in all of the sets in a wirless network and helps identify them as part of the network. Because both points connec to the same network they need the same SSID.

7 0
3 years ago
This graph shows a relationship between the height of a giraffe and its weight which term describe the dashed line through the g
Nadusha1986 [10]

Answer: The Answer is C

Explanation: This is because It is mainly controlled by genetics and we can not manipulate genetics.

4 0
3 years ago
Read 2 more answers
What are the coordinates of the origin point? (Select the best answer.)
siniylev [52]

Answer:

1,10

Explanation:

7 0
3 years ago
Write a Python program called wdcount.py which uses a dictionary to count the number of occurrences of each word (ignoring case)
Art [367]

The program is an illustration of loops.

<h3>What are loops?</h3>

Loops are program statements used to perform repetition

<h3>The wordcount.py program</h3>

The program written in Python, where comments are used to explain each line is as follows

# This opens the file in read mode

text = open("myFile.txt", "r")

# This creates an empty dictionary

d = dict()

#This iterates through the text

for line in text:

# This splits the line into words, after removing leading & trailing spaces, and newline characters

words = line.strip().lower().split(" ")

# This iterates through all the words

for word in words:

 # The following if condition counts the occurrence of each word

 if word in d:

  d[word] = d[word] + 1

 else:

  d[word] = 1

#This prints the words and their frequencies, in descending order

for w in sorted(d, key=d.get, reverse=True):

   print(w, d[w])

Read more about loops at:

brainly.com/question/16397886

5 0
1 year ago
Explain the quality-improvement process.
Tasya [4]

Answer:

 The quality improvement is the process that involve the complete organization in pursuit of the quality. It basically helps to improve the team knowledge and in decision making by using the validate data.  

The quality improvement is the proactive undertaking of recognizing, breaking down and enhancing existing business forms inside an association for enhancement and to satisfy new portions or guidelines of value.

 The main factors of the quality improvement are:

  • Leadership quality
  • Monitoring various types of systems
  • High availability of resources
  • Adequate infrastructure

3 0
3 years ago
Read 2 more answers
Other questions:
  • Discuss in detail why you need to use a write blocker (either hardware or software) in your examinations, whether for a criminal
    6·1 answer
  • Describe software as a service. what features distinguish it from application software installed on a personal computing device
    11·2 answers
  • AddAll - Adds all the doubles in the string with each other. Note every double is separated by a semi-colon. AddAll("1.245;2.9")
    6·1 answer
  • Create a 4x5 matrix with ones everywhere and zeros on the last row.
    14·1 answer
  • What type of backlighting receives dc power directly from a motherboard and doesn't use an inverter?
    11·1 answer
  • Which of the following best describes a feedback loop?
    11·1 answer
  • You compared each letter in the correct word to the letter guessed.
    5·1 answer
  • The system where the unit of measurement is centimeter
    15·1 answer
  • What is control structure write it's types​ .
    15·1 answer
  • 23. Convert the following to Megabytes<br> a) 2GB<br> b) 2056 Bytes-
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!