Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Cattle Drive and the fly likes Assignment 1-b Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Assignment 1-b" Watch "Assignment 1-b" New topic
Author

Assignment 1-b

Debbie Christian
Greenhorn

Joined: Mar 26, 2001
Posts: 8
I am utterly confused.
The following is a part of my submission for ib -
> //calculate number of complete lines that is possible

(Marilyn deleted code to protect future participants)

- and I got nitpicked as follows -
What happens if the name is just perfectly long enough that you
write exactly 80 characters? ( like "sue", "bill" or "marilyn" )
- that and the fact that when use 'bill' to run the program, it[ the program] inserted an extra line between the lines, made me think that I needed to count the nbr of chars being printed to the screen. This I did and got nitpicked as follows -
Looks like you are depending on something that the operating system
does. The program will be simpler if you don't concern yourself with
squeezing in that last tidbit of optimization. I suggest that instead, you
simply avoid the 80th character and always force a new line at the end of
each line.
- but I did start a new line after every line that was printed -

HElp!!

[This message has been edited by Marilyn deQueiroz (edited April 05, 2001).]
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
The problem is that not all consols behave the same way. If you do checking to see if you if you hit the 80th spot exactly and then not have it force a line in that case, it will work on some but maybe not others. Just avoiding the 80th character in the first place is easier and a more elegant solution.
Bill
John Bateman
Ranch Hand

Joined: Mar 09, 2000
Posts: 320
Hmmm...
I want to say how I did it because I am thinking it will be considered a 'cheat'. But I don't want to give anything away...
What a dilemna

------------------
SOURCE CODE should be SURROUNDED by "code" tags.
Click here for an example


SOURCE CODE should be SURROUNDED by "code" tags.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Assignment 1-b
 
Similar Threads
Is it true
List of students whose assignments I currently have pending
mailing assignments to nitpick
Java-1b: Pretend the line-width is 79
OOP-2 : NaturalLanguageMultiply