This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Submitting assignments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Submitting assignments" Watch "Submitting assignments" New topic
Author

Submitting assignments

Paul Ralph
Ranch Hand

Joined: Aug 10, 2000
Posts: 312
Hey there, hope everyone is doing well with their assignments and that Paul "nitpicker" Wheaton isn't too swamped.
Anyway, I have been doing my assignments using Textpad (www.textpad.com). It's fabulous for saving files and clarity (braces turn red, reserved words are blue, etc. I finally figured out that you convert tabs to spaces automatically, but I still have trouble converting the files when placing them in a Yahoo email.
Note: count should be changed to i but that's not the point.
Specifically
for ( int count=0; count<numberLine; count++ )<br /> gets wrapped around and by the time I get it submitted<br /> I get a comment like this <br /> > }
> for ( int count=0; count<numberLine;<br /> > count++ )
spacing!

So...should I align count (uh,I mean i) with for, the parenthesis, count...or should I just find a better email service?! I have an outlook express email address, but I can't send email from it (don't know why) and it's going to be obsolete in a few months anyway.
Do other email services have a bigger space to put text in?
Thanks in advance for your help
Paul R
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20494
    ∞

I'm not sure what's going on. I usually factor in word wrap for different e-mail programs. If you think your e-mail program is giving you grief, try yahoo - it's free.
But the spacing should look something like this:
for ( int i = 0 ; i < 10 ; i++ )
I'll accept stuff like this:
for( int i = 0; i < 10; i++)
I hope this helps


permaculture Wood Burning Stoves 2.0 - 4-DVD set
Paul Ralph
Ranch Hand

Joined: Aug 10, 2000
Posts: 312
All right, now I'm really confused. I already use Yahoo, and I thought that was the problem. Since you say you allow for wordwrap I guess I will have to send this question to you directly in more detail
Paul R
Paul Ralph
Ranch Hand

Joined: Aug 10, 2000
Posts: 312
Be patient for that email. Yahoo is unavailable and I can't quote my code.
Paul
Paul Ralph
Ranch Hand

Joined: Aug 10, 2000
Posts: 312
After some study, I think I have the spacing thing understood, but I would like one clarification.
At the end of a line you would like a space before between semicolons and identifiers, but no spaces between semicolons and the end of a line otherwise.
Like this:
namesPrinted ;
namesPrinted = 0;
name.length();
+ " ";
I would like a reply here, but I'll be submitting my latest version in the meantime anyway.
Thanks!
Paul R
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20494
    ∞

a space is required on either side of an identifier. Except for method names - they should be immediately followed by a left paren.
Your example stuff was kinda hard to follow as it isn't exactly valid code. Wanna take another stab at it?
Paul Ralph
Ranch Hand

Joined: Aug 10, 2000
Posts: 312
Example of bad english
>At the end of a line you would like a space before between >semicolons and identifiers, but no spaces between semicolons >and the end of a line otherwise.
Here's hoping the following is clearer.
Rule for spacing at the end of a line:
A space between semicolons and identifiers. (a)
No space before a semicolon otherwise -- no space between a semicolon and a number (b), a semicolon and a quote (c), or a semicolon and a closing parenthesis. (d)
Examples of the above in order:
(a) namesPerLine = 100 - namesPrinted ;
(b) int namesPrinted = 0;
(c) String name = args[0] + " ";
(d) int namesPerLine = screenWidth / name.length();
These statements are not meant to put together in code -- just examples of proper spacing.
Did I get the spacing correct??? (And did you understand what I was saying this time?)
Thanks
Paul R

paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20494
    ∞

a) looks good
b) acceptable, althoug I usually add a space before the ;
c) looks good
d) looks good
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Submitting assignments
 
Similar Threads
Reset Button
jtable help
JavaRanch is giving two books away this week
Small Complaint
CattleDriveSpacingRequirements