Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26912 > unrolled thread

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

Started byjohn <giorgiobianchi5@gmail.com>
First post2013-12-14 18:37 -0800
Last post2013-12-15 10:10 -0500
Articles 11 — 7 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  need some help with this program, I am stumped appreciate any input, thank you john <giorgiobianchi5@gmail.com> - 2013-12-14 18:37 -0800
    Re: need some help with this program, I am stumped appreciate any input, thank you Joerg Meier <joergmmeier@arcor.de> - 2013-12-15 03:43 +0100
    Re: need some help with this program, I am stumped appreciate any input, thank you Joerg Meier <joergmmeier@arcor.de> - 2013-12-15 03:45 +0100
      Re: need some help with this program, I am stumped appreciate any input, thank you Jeff Higgins <jeff@invalid.invalid> - 2013-12-15 10:15 -0500
        Re: need some help with this program, I am stumped appreciate any input, thank you Joerg Meier <joergmmeier@arcor.de> - 2013-12-15 18:19 +0100
          Re: need some help with this program, I am stumped appreciate any input, thank you Lew <lewbloch@gmail.com> - 2013-12-17 10:52 -0800
            Re: need some help with this program, I am stumped appreciate any input, thank you Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-12-19 20:29 +0000
    Re: need some help with this program, I am stumped appreciate any input, thank you Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-12-15 10:07 -0500
      Re: need some help with this program, I am stumped appreciate any input, thank you Arne Vajhøj <arne@vajhoej.dk> - 2013-12-15 10:24 -0500
      Re: need some help with this program, I am stumped appreciate any input, thank you Jeff Higgins <jeff@invalid.invalid> - 2013-12-15 10:29 -0500
    Re: need some help with this program, I am stumped appreciate any input, thank you Jeff Higgins <jeff@invalid.invalid> - 2013-12-15 10:10 -0500

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

Fromjohn <giorgiobianchi5@gmail.com>
Date2013-12-14 18:37 -0800
Subjectneed some help with this program, I am stumped appreciate any input, thank you
Message-ID<ea4e5a75-3844-47df-b548-4cdc8fcb417a@googlegroups.com>
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.

[toc] | [next] | [standalone]


#26914

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-12-15 03:43 +0100
Message-ID<113b6dlz3xjow$.lrj70n9mm1t1$.dlg@40tude.net>
In reply to#26912
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.

[toc] | [prev] | [next] | [standalone]


#26915

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-12-15 03:45 +0100
Message-ID<37qi46r2migu.128f667ofnzw5.dlg@40tude.net>
In reply to#26912
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.

[toc] | [prev] | [next] | [standalone]


#26929

FromJeff Higgins <jeff@invalid.invalid>
Date2013-12-15 10:15 -0500
Message-ID<l8kh4u$q8$1@dont-email.me>
In reply to#26915
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.

[toc] | [prev] | [next] | [standalone]


#26932

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-12-15 18:19 +0100
Message-ID<w9l2gi7m55tp.19b9s9hro8qdz$.dlg@40tude.net>
In reply to#26929
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.

[toc] | [prev] | [next] | [standalone]


#26971

FromLew <lewbloch@gmail.com>
Date2013-12-17 10:52 -0800
Message-ID<e78485fe-a278-48f7-9e44-88bcfa3c5444@googlegroups.com>
In reply to#26932
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 assume the 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

[toc] | [prev] | [next] | [standalone]


#26997

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2013-12-19 20:29 +0000
Message-ID<slrnlb6lpe.42s.avl@gamma.logic.tuwien.ac.at>
In reply to#26971
Lew <lewbloch@gmail.com> 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...

[toc] | [prev] | [next] | [standalone]


#26927

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2013-12-15 10:07 -0500
Message-ID<l8kgjo$t65$1@dont-email.me>
In reply to#26912
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{
	java.io.BufferedReader ooo=new java.io.BufferedReader
	(new java.io.InputStreamReader(new java.net.URL("http:"
	+"//oeis.org/A005188/b005188.txt").openStream()));try{
	for(java.lang.String ooO;(ooO=ooo.readLine())!=null;){
	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
esosman@comcast-dot-net.invalid

[toc] | [prev] | [next] | [standalone]


#26930

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-12-15 10:24 -0500
Message-ID<52adc9b8$0$302$14726298@news.sunsite.dk>
In reply to#26927
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{
>      java.io.BufferedReader ooo=new java.io.BufferedReader
>      (new java.io.InputStreamReader(new java.net.URL("http:"
>      +"//oeis.org/A005188/b005188.txt").openStream()));try{
>      for(java.lang.String ooO;(ooO=ooo.readLine())!=null;){
>      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

[toc] | [prev] | [next] | [standalone]


#26931

FromJeff Higgins <jeff@invalid.invalid>
Date2013-12-15 10:29 -0500
Message-ID<l8khvj$5vi$1@dont-email.me>
In reply to#26927
An LUT. Wow, who'd a thunk it.

[toc] | [prev] | [next] | [standalone]


#26928

FromJeff Higgins <jeff@invalid.invalid>
Date2013-12-15 10:10 -0500
Message-ID<l8kgsr$v2o$1@dont-email.me>
In reply to#26912
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
<http://home.earthlink.net/~patricia_shanahan/beginner.html>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web