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

J

john

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.
 
J

Joerg Meier

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
 
J

Joerg Meier

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
 
E

Eric Sosman

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;}
 
J

Jeff Higgins

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>
 
J

Jeff Higgins

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.
 
A

Arne Vajhøj

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
 
L

Lew

Joerg said:
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.
 
A

Andreas Leitgeb

Lew said:
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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top