Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Say 4b

 
Ellen Smith
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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....
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • 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).]
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • 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) ;-)
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • Mark post as helpful
  • send pies
  • 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
  • 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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic