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
lyudmila [28]
3 years ago
10

6-1) (Math: pentagonal numbers) A pentagonal number is defined as n(3n–1)/2 for n = 1, 2, . . ., and so on. Therefore, the first

few numbers are 1, 5, 12, 22, . . . . Write a method with the following header that returns a pentagonal number: public static int getPentagonalNumber(int n) Write a test program that uses this method to display the first n pentagonal numbers with 10 numbers on each line, one space between each number, and the user entering the integer value for n.
Computers and Technology
1 answer:
Igoryamba3 years ago
7 0

Answer:

Check the explanation

Explanation:

public class Exercise_06_01 {

/** Main Method */

public static void main(String[] args) {

 final int NUMBER_OF_PENTAGONALS = 100; // Display the first 100 pentagonals

 final int NUMBER_PER_LINE = 10; // Display 10 number per line

 // Display the first 100 pentagol numbers

 System.out.println("The first 100 pentagonal numbers, ten per line: ");

 for (int i = 1; i <= NUMBER_OF_PENTAGONALS; i++) {

  // Print ten numbers per line

  if (i % NUMBER_PER_LINE == 0)  

   System.out.printf("%7d\n", getPentagonalNumber(i));

  else

   System.out.printf("%7d", getPentagonalNumber(i));

 }

}

/** Return a pentagonal number */

public static int getPentagonalNumber(int n) {

 return (n * (3 * n - 1)) / 2;

}

}

You might be interested in
1. A(n)
Dennis_Churaev [7]

Answer:

1.Spelling checker


2. Order of mathematical operations .

3. Series  

4. Pick from list  

5. Sum Function


6. Active Cell  

7. cell


8. Accounting format


9. Format

Explanation:

4 0
3 years ago
What is the intermediate value of arr after two iterations of the outer for loop in the call sort(arr)
astra-53 [7]

The intermediate value of arr after two iterations of the outer for loop in the call sort(arr) is option C of the image attached.

<h3>What is intermediate value in programming?</h3>

This is known to be a variable that is often employed in assisting so that one can be able to compute what they want

Concluisvely, The intermediate value of arr after two iterations of the outer for loop in the call sort(arr) is option C of the image is because it will help you to have what you are after with the codes.

Learn more about ntermediate value from

brainly.com/question/11195842

#SPJ2

5 0
3 years ago
Read 2 more answers
As the network engineer, you are asked to design an IP subnet plan that calls for three subnets. The largest subnet needs a mini
Delvig [45]

Answer:

192.168.0.0 / 255.255.255.192

Explanation:

Given:

As the network engineer, you are asked to design an IP subnet plan that calls for three subnets. The largest subnet needs a minimum of 52 hosts. Management requires that a single mask must be used throughout the Class C network.

Solution:

192.168.0.0 / 255.255.255.192 is a private IP network and mask that would meet the requirements.

8 0
3 years ago
Of all the database types we have studied, which database seems most appropriate for a startup building a new note-taking app fo
Deffense [45]

Answer:

<u>documents database</u>

Explanation:

This database is most appropriate because we need to remember that a <u>note-taking app</u> would not necessarily need too many functions apart from the basics text input operations.

Also, we need to note that the digital infrastructure required to build a documents database, is very convenient for a startup because they may have lesser resources.

7 0
3 years ago
Read 2 more answers
If you can photoshop please text me i need help for my digital media class 7862381441
yKpoI14uk [10]

Answer:

I don't know what that is but what type of work you need help with

have a good day :)

Explanation:

5 0
3 years ago
Other questions:
  • A ________ is s field or set of fields in a record that uniquely defines the record.
    7·1 answer
  • Imagine that you've properly connected your multimeter into an operating circuit, and the meter's function/range switch is set t
    14·2 answers
  • When green, this signal means __________ A. yield to pedestrians and vehicles that are still in the intersection. B. you have th
    12·2 answers
  • Naseer has inserted an image into his document but needs the image to appear on its own line.
    5·2 answers
  • (a) Explain the difference between a web browser and a search engine.​
    15·1 answer
  • _____________ helps to control and limit the number of consecutive request failures that cross a threshold. Review breaker Micro
    7·1 answer
  • What’s an input Device
    7·2 answers
  • How to Calculate the area of a rectangle in python
    13·2 answers
  • _________ is the method used by password crackers who work with pre-calculated hashes of all passwords possible within a certain
    6·1 answer
  • You are given the following design parameters, fill in the table: All memory addresses are 32-bit long; A 64Kbyte (2^16 byte) ca
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!