Forums Register Login

Say 4b

+Pie Number of slices to send: Send
Are we supposed to be using all integers for this assignment? I am having a problem and don't know what to do. If I use integers, when I put in digits greater than 32,728 or so, my program bombs. But if I use all longs, when I do modulus arithmetic in the method I used in my first assignment, that won't work either. Any suggestions as to what I am doing wrong. I am really getting desperate. Thanks for any help I can get....
+Pie Number of slices to send: Send
ellen, i am using a long to start the program, but then i cast to an int when i need to... something like this:
int newNumber = (int)( longValue / intValue );
i also use some math to change the value of the long without the cast... that looks something like this:
longValue = longValue % intValue ;
i hope this helps! btw, i haven't passed 4b yet, but my nitpicks haven't been about my casting so i guess this is okay.
also, if i gave too much away please tell me so i can delete this!
[This message has been edited by Greg Harris (edited June 19, 2001).]
+Pie Number of slices to send: Send
I think this sort of help should be allowed, to really find out
this sort of knowledge yourself is not necessary. Learning from examples is very good too, IHMO (in my humble opinion) ;-)
+Pie Number of slices to send: Send
Greg the basic rule is : "if you don�t post actual code you�re OK".
There are however exceptions.
  • If the objective of an assignment is to find a specific class in the SDK, well don�t mention THE CLASS !!!
  • Also if the instructors solution is pretty neat or unique pse don�t let the others still doing the assignment know about it.

  • Thanks
    ps If I think you give away anything I'll delete it
    [This message has been edited by Johannes de Jong (edited June 20, 2001).]
+Pie Number of slices to send: Send
Well thanks for all your help. I'll try ANYTHING just about now just to say sane.
[This message has been edited by Ellen Smith (edited June 20, 2001).]
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1328 times.
Similar Threads
Help Java 4b ???
Extracting integers from strings
could someone explain stringTokenizer
how to read integers from keyboard?
Developing editor
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:10:03.