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
alexandr1967 [171]
2 years ago
11

Class Main {

Computers and Technology
1 answer:
Ganezh [65]2 years ago
4 0

Answer:

class Main {

 static void printPowers(int howMany, int nrRows) {

   for(int n=1; n<=nrRows; n++) {

     for(int power = 1; power<=howMany; power++) {

       System.out.printf("%d ", (int) Math.pow(n, power));

     }

     System.out.println();

   }

 }

 public static void main(String[] args) {

   printPowers(3, 5);

 }

}

class Main {

 static void printPowers(int howMany, int nrRows) {

   int n = 1;

   do {

     int power = 1;

     do {

       System.out.printf("%d ", (int) Math.pow(n, power));

       power++;

     } while (power <= howMany);

     System.out.println();

     n++;

   } while (n <= nrRows);

 }

 public static void main(String[] args) {

   printPowers(3, 5);

 }

}

Explanation:

The for loop gives the cleanest, shortest code.

You might be interested in
How can I put my keyboard back​
zvonat [6]

Flip the laptop over, take off the screws that hold the frame together. Flip it back, take off the top plate. Then, slide the keyboard back in. Replace the frame, and then rescrew the screws. Replace the back side after.

~

8 0
3 years ago
Suppose that, even unrealistically, we are to search a list of 700 million items using Binary Search, Recursive (Algorithm 2.1).
damaskus [11]

Answer:

There is also an attachment below

Explanation:

Since we are talking about binary search, let's assume that the items are sorted according to some criteria.

Time complexity of binary search is O(logN) in worst case, best case and average case as well. That means it can search for an item in Log N time where N is size of the input. Here problem talks about the item not getting found. So, this is a worst case scenario. Even in this case, binary search runs in O(logN) time.

N = 700000000.

So, number of comparisions can be log(N) = 29.3 = 29.

So, in the worst case it does comparisions 29 times

7 0
3 years ago
Define a JavaScript function named showGrades which does not have any parameters. Your function should create and return an arra
grandymaker [24]

Answer:

see explaination

Explanation:

//selective dev elements by id name

var gradeA = document.querySelector("#GradeA");

var passing = document.querySelector("#Passing");

var learning = document.querySelector("#Learning");

//function showGrades

function showGrades() {

var arr = [];

//converting string to int and inserting into array

arr[0] = parseInt(gradeA.textContent);

arr[1] = parseInt(passing.textContent);

arr[2] = parseInt(learning.textContent);

//creating json blob

var blob = new Blob(new Array(arr), {type:"text/json"});

return blob;

}

8 0
4 years ago
Which of these can be considered data?<br> A:facts<br> B:information<br> C:belief<br> D:all of these
IceJOKER [234]

A) facts.

Facts is the only thing that can be considered REAL data.

6 0
3 years ago
1. Paying attention to the trends that might impact your future career is called
amm1812
The answer is A futurecasting.
8 0
4 years ago
Read 2 more answers
Other questions:
  • Assume that a program consists of integer and floating-point instructions. 60% of the total execution time is spent on floating
    7·1 answer
  • Which strategies should you follow if you begin to feel fatigued while driving
    12·2 answers
  • To record your own audio, you must have _____.
    14·2 answers
  • LEAF library in py can be expressed in what form?
    6·1 answer
  • Natalie is a secretary and must complete a large amount of filing this afternoon. At 1:00 PM, the office receptionist gets sick
    10·1 answer
  • Draw a flowchart diagram for a program that display a person's name x times​
    5·1 answer
  • Which is the correct code to declare a catch-all handler?
    13·1 answer
  • What is computer software? How do you classify them?​
    8·2 answers
  • TRUE OR FALSE
    14·1 answer
  • Write 10 sentences of your own and underline the verb.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!