Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About assignment java-1b(hundred)

 
kamabotti khan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what to learn or know about to do assignment java 1b since i am not understanding
how to implement things so that the console should 80 characters wide.

Thank You
 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try playing around with module (%) and see how this can help you. Look it up and see how that can help you. There might be some other way of doing this but I would try that first.

Good Luck!
Gary
 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the console has space for exactly 80 characters, use that knowledge to rewrite assignment 1 so that no matter what name is used for the argument, that name will print completely each time, and if it does not fit entirely, will print on the the next line instead of being split into 2 halves.
(Hint: use your math skills)
 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carol,
wait is my start up the wrong way to do it?

=)
 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gary, sometimes the solution to a relatively simple problem remains elusive even after one gets a few good hints. I'm not sure exactly what Kamabotti has tried, but from my own experience with this one, the fact that the console was 80 characters wide was news to me. (I have no formal computer background) Using this knowledge, along with basic math skills, I was eventually able to hash out a solution. It took me a few tries, and really made me aware that I had to learn to approach these programming assignments from a direction I was not accustomed to taking!
All hints are of value, as long as they don't just give the answer away completely. Learning to think a little about the approach to a problem is good, and if you can't come up with a good approach, then just jump in and start writing something. The things that don't work may teach you something as well!
 
paul wheaton
Trailboss
Pie
Posts: 21741
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The word is "modulo"

 
Gary Ba
Ranch Hand
Posts: 161
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The word is "modulo"


Thanks Paul!
 
Carol Murphy
village idiot
Bartender
Posts: 1203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
paul wheaton wrote:The word is "modulo"



Errrr...., missed that little nicety!
Must not have been wearing my glasses that day!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic