• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Say 4b

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....
 
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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) ;-)
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Ellen Smith
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Arch enemy? I mean, I don't like you, but I don't think you qualify as "arch enemy". Here, try this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic