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 many bits would be needed to count all of the students in class today?There are 25 in class
monitta

Answer:

50?

Explanation:

8 0
3 years ago
Read 2 more answers
A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 servings in the bag and that a se
laila [671]

Answer:

import java.util.Scanner;

public class ANot {

   public static void main(String[] args) {

   Scanner in = new Scanner (System.in);

       System.out.println("How many cookies did you eat today");

       int numOfCookies = in.nextInt();

       double numCalories = (numOfCookies*300)/4;

       System.out.println("The total number of calories you consumed in "+numOfCookies+" cookies is " +

               " "+numCalories);

   }

}

Explanation:

This code is implemented in Java.

  1. We know from the question that 4 cookies contain 300 calories
  2. Therefore number of calories consumed = (number of cookies eaten*300)/4
  3. To implement this in java we used the scanner class to prompt user for the input
  4. save the input to a variable and write mathematical expression for the number of calories consumed
  5. Then output the result

4 0
3 years ago
The smallest unit of storage is​
Snowcat [4.5K]

Answer:

Hey mate......

Explanation:

The smallest unit of storage is Bytes......

hope it helps you,

mark me as the brainliest,

follow me..........

3 0
3 years ago
give one word • pressure exerted by a stationary liquid _______. • force in a direction perpendicular to a given surface area __
mel-nik [20]

Answer:

1. Hydrostatic pressure.

2. Pressure.

3. Equilibrium forces.

Explanation:

1. <u>Hydrostatic pressure</u>: pressure exerted by a stationary liquid. It is simply the pressure in a liquid such as water at a specific depth.

Mathematically, hydrostatic pressure is given by the formula;

H.P = rho * g * d

Where:

  • H.P is the hydrostatic pressure of a liquid.
  • rho represents the density of a liquid.
  • g is the acceleration due to gravity.
  • d is the depth (height) of a liquid.

2. <u>Pressure</u>: it is the force in a direction perpendicular to a given surface area. Thus, it's typically measured in Newton per meters (N/m²).

Mathematically, pressure is given by the formula;

Pressure = \frac {Force}{area}

3. <u>Equilibrium forces</u>: a pair of forces whose resultant is zero. It is also referred to as balanced forces because the resultant of all the pair of forces acting on a body or system is at equilibrium (balanced).

6 0
3 years ago
True/False: Audio menus can be useful when one's hands and eyes are busy, or to assist vision-impaired users. With audio menus,
Aloiza [94]

Answer:

I believe the answer is true

5 0
3 years ago
Other questions:
  • How many bits are required to address a 1mx8 main memory if main memory is byte addressable?
    6·1 answer
  • A network administrator wants to logically separate web servers on the network. Which of the following network device will need
    10·2 answers
  • A bluetooth network consists of _____ primary device(s) and up to ____ secondary devices.
    8·1 answer
  • 2:3:5<br>_ _ _<br>3 2 8<br><br><br><br>find ratio​
    5·1 answer
  • The bubble sort algorithm sorts using what technique?
    14·1 answer
  • Jeremy has created a document that has images and a chart. The chart has to be updated manually, and double-clicking on the char
    15·1 answer
  • If a student passes off an author’s work as his or her own, the student has
    6·1 answer
  • Is an automatic computer check to ensure that the data entered is sensible and reasonable.It does not check the accuracy of data
    7·1 answer
  • Why do you think Jacinda believed what people told her about her own beauty? Even if you understand that what you see on social
    13·1 answer
  • Select the correct answer..
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!