# java homework

Write [url removed, login to view] from page 212 Ninth edition.

" [url removed, login to view] (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)"

Pentagonal numbers illustration and general equation....

Which is Pn = ( 3 * n2 - n )/2

Note for n =1 we have one vertex point

for n = 2 we share vertex points for n=1 and add four more points this gives a pentagonal P2= 5 points

For P3, we share vertex points of P2 and add 7 more points this gives P3 = 12 points

For P4 we add 10 more points + 12 from P3 gives a P4 = 22.

You will read a single integer from standard input and print out the the first n pentagonal numbers, where n was integer just read. All numbers will be printed space then number, last pentagonal number is new line terminated.

Sample Run 1 (Input 2):

Enter an integer: 2

The pentagonal numbers are: 1 5

Sample Run 2 (User input's 4):

Enter an integer: 4

The pentagonal numbers are: 1 5 12 22

Sample Run 3 (NetBeans output window user inputs 7)

run:

Enter an integer: 7

The pentagonal numbers are: 1 5 12 22 35 51 70

BUILD SUCCESSFUL (total time: 7 seconds)

Hint the method getPentagonalNumber( int n ), is singular, but you can write your method to kick out and array 1..n.

Hint,

For [url removed, login to view] with input 2, you will need to output:space1space5newline, so we print a space then a number.

The only catch the last number ends in newline not space.

Lets look at another example, you want to read in n and print out the squares of 1 up to n^2, last one is newline terminated.

For example, input n=3; Output: "The square numbers are: 1 4 9\n" - this Simple loop will work....

[url removed, login to view]( "The square numbers are: " );

for( int i = 1; i <= n ; ++i ) [url removed, login to view]( i*i + ( i-1<n ? " " : \n" ) );

スキル： デルファイ, Java, 数学, パール, パイソン

さらに表示： freelancer homework java

( 2件のレビュー ) Irvine, United States

プロジェクトID: #11801283

## 49人のフリーランサーが、このジョブに平均\$22で入札しています

dobreiiita

Hello I am Java expert and interested in this project. I have reviewed the details and confident to handle it perfectly. I have a lot of experience in helping in students with assignments, so I will keep codes w もっと

\$30 USD 1日以内
(427件のレビュー)
7.4
Softeria

Hire me directly from my profile. I can do your project. Dear, you project is illegal on this website and will soon be delated. So, you can hire me directly by going to my profile. Thanks Note: No freelancer can reply もっと

\$24 USD 1日以内
(114件のレビュー)
6.6
utkarshkatiyar19

Hi, i have a lot of experience in java programming. i can easily complete this task for you. we can have a chat. thanks

\$30 USD 1日以内
(195件のレビュー)
6.7
AhmedLabib93

Hello My name is Ahmed, i'm a top rated freelancer. i worked over 250 projects and over 600 hours doing java projects. plus i passed freelancer java exam with top 15% plus i got 2 java certificate 1Z0-803 and 1Z0- もっと

\$15 USD 1日以内
(324件のレビュー)
6.4
NovaSofts

Hello Sir/Mam NovaSofts Inc. is the leading IT Company of Islamabad Pakistan. We have 9+ years of experience and strong knowledge about programming languages Java C++ C C# Android So you don't worry about thir もっと

\$30 USD 1日以内
(116件のレビュー)
6.5
\$55 USD 1日以内
(117件のレビュー)
6.1

Hello sir. This is simple requirement so I can do it in 1 hour. If you are interested we can discuss more. Regards

\$15 USD 1日以内
(119件のレビュー)
6.0
sambestsolutions

Hi I am an Engineering undergraduate experienced in java programming for more than 3 year. I can do this for you. Please message to discuss further on this. Thanks Note-please check my profile for past projects and もっと

\$25 USD 1日以内
(102件のレビュー)
5.7
\$30 USD 1日以内
(68件のレビュー)
5.4
DemonDeveloper

We are team of excellent developers. We have 2 year experience related to your project field. We can do your project and solve your all problems according to your requirements. We have read your description for project もっと

\$30 USD 1日以内
(27件のレビュー)
4.3

A proposal has not yet been provided

\$30 USD 2日以内
(29件のレビュー)
4.5
Techxygen

Hi, I read the assignment description and completely understand it. I’m highly interested in your project as it lies within my domain of expertise. I’m a software engineer and have excellent programming and problem sol もっと

\$20 USD 1日以内
(6件のレビュー)
4.1
gguliashvili

Hi, I've been in competitive programming for a while. I won silver medal on International Olympiad of Informatics, also I'm finalist of the ACM ICPC. I'm experienced in Machine Learning, AI, algorithms and data s もっと

\$15 USD 1日以内
(5件のレビュー)
3.8
bhoir

hello, consider it some. pls have a look at my profile for work and experience. looking fwd to hear back from I. thanks. regards sandip

\$20 USD 1日以内
(6件のレビュー)
3.5
umar037

this is very easy task.. can do it in 1 hour as i am java expert thank you

\$25 USD 1日以内
(6件のレビュー)
3.3
nishantsingh0907

A proposal has not yet been provided

\$15 USD 1日以内
(4件のレビュー)
3.0
skriyaz09

I have been working as a software developer for more than one and half year and having good knowledge of algorithms and data structures and good at problem solving

\$25 USD 1日以内
(5件のレビュー)
2.8
abubakar4248

hi I am professionally software engineer having 2 years experience in this field I read the descriptions well and understand. I have lot of experience in java I will provide quality work according to your require もっと

\$40 USD 1日以内
(8件のレビュー)
3.6