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
Do Violent Video Games Make People More violent in Real Life ?
vova2212 [387]
To be honest, NO. Its just a videogame but i see what you are saying...
4 0
3 years ago
The linux and macos program traceroute is known by a slightly different name on windows. it's referred to as ______.
kompoz [17]

The answer is 'tracert'. Tracert or traceroute command is a form of a diagnostic tool which allows you to capture information as the packet is sent from the source and destination providing the route taken and measure of delay across the IP network.

7 0
3 years ago
When issued a GFE device, you are required to sign an AUP
pav-90 [236]
GFE stands for Government Furnished Equipment. While AUP is Acceptable Use Policy (AUP). The AUP  should be read and signed by employees annually.  <span><span> </span></span>The statement that "When issued a GFE device, you are required to sign an AUP" is true. 
7 0
2 years ago
Read 2 more answers
Write a program that uses an STL List of integers. a. The program will insert two integers, 5 and 6, at the end of the list. Nex
poizon [28]

Answer:

answer:

#include <iostream>

#include<list>

using namespace std;

bool Greater(int x) { return x>3; } int main() { list<int>l; /*Declare the list of integers*/ l.push_back(5); l.push_back(6); /*Insert 5 and 6 at the end of list*/ l.push_front(1); l.push_front(2); /*Insert 1 and 2 in front of the list*/ list<int>::iterator it = l.begin(); advance(it, 2); l.insert(it, 4); /*Insert 4 at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl; l.erase(it); /*Delete the element 4 inserted at position 3*/ for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " "; /*Display the list*/ cout<<endl;

l.remove_if(Greater); for(list<int>::iterator i = l.begin();i != l.end();i++) cout<< *i << " ";

/*Display the list*/

cout<<endl; return 0;

}

5 0
3 years ago
Read 2 more answers
What is the purpose of netiquette guidelines?
sp2606 [1]
The purpose of netiquette guidlelines is to provide a safe and secure environment for internet users everywhere
7 0
3 years ago
Other questions:
  • You browsing internet and you realize that its not responding what do you do with out rebooting the computer
    10·1 answer
  • A retail company assigns a $5000 store bonus if monthly sales are $100,000 or more. Additionally, if their sales exceed 125% or
    5·1 answer
  • Martha wants to invite her coworkers to her birthday party. She uses the mail merge feature to compose and send the invitations.
    6·1 answer
  • Computer keyboard failures can be attributed to electrical defects or mechanical defects. A repair facility currently has 25 fai
    14·1 answer
  • Which one of these is correct PI of a XML document?
    13·1 answer
  • What do financial planning skills ultimately enable an individual to do?
    10·2 answers
  • Match the following.
    8·1 answer
  • Write an algorithm to verify a number as even​
    9·1 answer
  • The term information technology was first used what year?
    15·2 answers
  • What type of access controls allow the owner of a file to grant other users access to it using an access control list
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!