need some help with this program, I am stumped appreciate any input,thank you

Discussion in 'Java' started by john, Dec 15, 2013.

1. johnGuest

An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method called isArmstrongNum to determine if a given number is an Armstrong number. Write a program that generates 100 three-digit random numbers and calls isArmstrongNum method to find all Armstrong numbers among these 100 random numbers.

john, Dec 15, 2013

2. Joerg MeierGuest

Re: need some help with this program, I am stumped appreciate any input, thank you

On Sat, 14 Dec 2013 18:37:09 -0800 (PST), john wrote:

> An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method called isArmstrongNum to determine if a given number is an Armstrong number. Write a program that generates 100 three-digit random numbers and calls isArmstrongNum method to find all Armstrong numbers among these 100 random numbers.

We are not here to do your homework for you. If you actually have any
problems with any of the instructions, feel free to ask specific questions.

Liebe Gruesse,
Joerg

--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

Joerg Meier, Dec 15, 2013

3. Joerg MeierGuest

Re: need some help with this program, I am stumped appreciate any input, thank you

On Sat, 14 Dec 2013 18:37:09 -0800 (PST), john wrote:

> An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method called isArmstrongNum to determine if a given number is an Armstrong number. Write a program that generates 100 three-digit random numbers and calls isArmstrongNum method to find all Armstrong numbers among these 100 random numbers.

By the way, your question isn't even correct: 3*3*3 is not 33, 7*7*7 is not
73, and 1*1*1 is not 13. Also, 33 + 73 + 13 is 119, not 371.

Liebe Gruesse,
Joerg

--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

Joerg Meier, Dec 15, 2013
4. Eric SosmanGuest

Re: need some help with this program, I am stumped appreciate anyinput, thank you

On 12/14/2013 9:37 PM, john wrote:
> An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method called isArmstrongNum to determine if a given number is an Armstrong number. Write a program that generates 100 three-digit random numbers and calls isArmstrongNum method to find all Armstrong numbers among these 100 random numbers.

Here's the crux; filling in the rest should be simple:

public static boolean isArmstrongNum(int oOO)throws
java.net.MalformedURLException,java.io.IOException{
+"//oeis.org/A005188/b005188.txt").openStream()));try{
java.lang.String[]oOo=ooO.split("\\s+");if(oOo.length
=='\u0002'&&oOo[oOo.length-1].equals(java.lang.Integer
.toString(oOO))){return true;}}}finally{ooo.close();}
return false;}

--
Eric Sosman
d

Eric Sosman, Dec 15, 2013
5. Jeff HigginsGuest

Re: need some help with this program, I am stumped appreciate anyinput, thank you

On 12/14/2013 09:37 PM, john wrote:
> An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method called isArmstrongNum to determine if a given number is an Armstrong number. Write a program that generates 100 three-digit random numbers and calls isArmstrongNum method to find all Armstrong numbers among these 100 random numbers.
>

So, You Need to Write a Program but Don't Know How to Start

Jeff Higgins, Dec 15, 2013
6. Jeff HigginsGuest

Re: need some help with this program, I am stumped appreciate anyinput, thank you

On 12/14/2013 09:45 PM, Joerg Meier wrote:
> On Sat, 14 Dec 2013 18:37:09 -0800 (PST), john wrote:
>
>> An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method called isArmstrongNum to determine if a given number is an Armstrong number. Write a program that generates 100 three-digit random numbers and calls isArmstrongNum method to find all Armstrong numbers among these 100 random numbers.

>
> By the way, your question isn't even correct: 3*3*3 is not 33, 7*7*7 is not
> 73, and 1*1*1 is not 13. Also, 33 + 73 + 13 is 119, not 371.
>

We still haven't found that missing caret.

Jeff Higgins, Dec 15, 2013
7. Arne VajhøjGuest

Re: need some help with this program, I am stumped appreciate anyinput, thank you

On 12/15/2013 10:07 AM, Eric Sosman wrote:
> On 12/14/2013 9:37 PM, john wrote:
>> An Armstrong number of three digits is an integer such that the sum of
>> the cubes of its digits is equal to the number itself. For example,
>> 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method
>> called isArmstrongNum to determine if a given number is an Armstrong
>> number. Write a program that generates 100 three-digit random numbers
>> and calls isArmstrongNum method to find all Armstrong numbers among
>> these 100 random numbers.

>
> Here's the crux; filling in the rest should be simple:
>
> public static boolean isArmstrongNum(int oOO)throws
> java.net.MalformedURLException,java.io.IOException{
> +"//oeis.org/A005188/b005188.txt").openStream()));try{
> java.lang.String[]oOo=ooO.split("\\s+");if(oOo.length
> =='\u0002'&&oOo[oOo.length-1].equals(java.lang.Integer
> .toString(oOO))){return true;}}}finally{ooo.close();}
> return false;}

This raises a very interesting question.

Are you most inspired by Stefans coding convention
or by Roedy's how to write unmaintainable code?

Arne

Arne Vajhøj, Dec 15, 2013
8. Jeff HigginsGuest

Re: need some help with this program, I am stumped appreciate anyinput, thank you

An LUT. Wow, who'd a thunk it.

Jeff Higgins, Dec 15, 2013
9. Joerg MeierGuest

Re: need some help with this program, I am stumped appreciate any input, thank you

On Sun, 15 Dec 2013 10:15:18 -0500, Jeff Higgins wrote:

> On 12/14/2013 09:45 PM, Joerg Meier wrote:
>> On Sat, 14 Dec 2013 18:37:09 -0800 (PST), john wrote:
>>> An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method called isArmstrongNum to determine if a given number is an Armstrong number. Write a program that generates 100 three-digit random numbers and calls isArmstrongNum method to find all Armstrong numbers among these 100 random numbers.

>> By the way, your question isn't even correct: 3*3*3 is not 33, 7*7*7 is not
>> 73, and 1*1*1 is not 13. Also, 33 + 73 + 13 is 119, not 371.

> We still haven't found that missing caret.

Oh, that makes much more sense. I feel silly now.

Liebe Gruesse,
Joerg

--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

Joerg Meier, Dec 15, 2013
10. LewGuest

Re: need some help with this program, I am stumped appreciate anyinput, thank you

Joerg Meier wrote:
> Jeff Higgins wrote:
> > Joerg Meier wrote:
> >> john wrote:
> >>> An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371. Write a method called isArmstrongNum to determine if a given number is an Armstrong number. Write a program that generates 100 three-digit random numbers and calls isArmstrongNum method to find all Armstrong numbers among these 100 random numbers.

>
> >> By the way, your question isn't even correct: 3*3*3 is not 33, 7*7*7 is not
> >> 73, and 1*1*1 is not 13. Also, 33 + 73 + 13 is 119, not 371.

>
> > We still haven't found that missing caret.

>
> Oh, that makes much more sense. I feel silly now.

Oh, you aren't the one who should be feeling silly. Why would anyone assumethe poster posted
something other than what they intended to post?

Silliness is on the part of the one who made the error, not the one who gave the respect to the
poster to assume intentionality.

--
Lew

Lew, Dec 17, 2013
11. Andreas LeitgebGuest

Re: need some help with this program, I am stumped appreciate anyinput, thank you

Lew <> wrote:
> Joerg Meier wrote:
>> Jeff Higgins wrote:
>>> Joerg Meier wrote:
>>>> john wrote:
>>>>> An Armstrong number of three digits is an integer such that the
>>>>> sum of the cubes of its digits is equal to the number itself.
>>>>> For example, 371 is an Armstrong number, since 33 + 73 + 13 = 371.
>>>> By the way, your question isn't even correct: 3*3*3 is not 33, 7*7*7
>>>> is not 73, and 1*1*1 is not 13. Also, 33 + 73 + 13 is 119, not 371.
>>> We still haven't found that missing caret.

>> Oh, that makes much more sense. I feel silly now.

> Oh, you aren't the one who should be feeling silly. Why would anyone
> assume the poster posted something other than what they intended to post?

I think, that on his screen, john may have actually *seen* a raised 3
after each of the 3,7,1. He just obviously wasn't aware, that text
formatting wouldn't make it through to many/most of the audience...

Alternatively, he might have typed the text with eyes on the keyboard,
and his keyboard layout may have the caret as a "dead-key". So, while
he might have typed a caret it just didn't show up, because he would
have had to press space-key to make the dead-key effective on its own.

PS: The silliness on my side includes (but isn't limited to) answering
a thread that's probably long since off the track...

Andreas Leitgeb, Dec 19, 2013