Results 1 to 13 of 13

Thread: Wished I had this in school.

  1. #1
    Mega Bore Atomic's Avatar
    Join Date
    Sep 2008
    Location
    los Estados Unidos de América
    Posts
    3,267
    Credits
    3,110
    Mentioned
    0 Post(s)

    Thumbs down Wished I had this in school.

    I'm trying to learn how to program in Java. I was playing with loops and made this niftty thing that I would attempt to use if my teacher forced me to write lines. First I'd have to beg the teacher to let me type them for educational purposes...

    LinesLoop.java

    Code:
    public class LinesLoop {
    
    	void printLines() {
    		for (int i = 1; i < 1001; ++i)
    			System.out.println(i + ". I will write all my lines. With numbers even.");
    	}
    	
    	public static void main(String[] args) {
    	LinesLoop a = new LinesLoop();
    	a.printLines();
    	}
    
    }

  2. #2
    Senior Member Infernus's Avatar
    Join Date
    Sep 2008
    Posts
    3,111
    Credits
    1,610
    Mentioned
    0 Post(s)

    Default

    reminds me of a foxtrot comic where he did that but with c

  3. #3
    Mega Bore Atomic's Avatar
    Join Date
    Sep 2008
    Location
    los Estados Unidos de América
    Posts
    3,267
    Credits
    3,110
    Mentioned
    0 Post(s)

    Default

    I guess then it's part of learning? These aren't in the book so I'm excited to have made them. With reference of course.

    Code:
    BeerBottles.java
    
    public class BeerBottles {
    	void printBottles() {
    		for (int i = 99; i >= 1;)
    			System.out.println(i + " bottles of beer on the wall. " + i + " bottles of beer. Take one down pass it around, " + (--i) + " bottles of beer on the wall.");
    	}
    	
    	public static void main(String[] args) {
    
    		BeerBottles a = new BeerBottles();
    		a.printBottles();
    		System.out.println("Who drank all the beer?");
    
    	}
    
    }

  4. #4
    Senior Member ChedWick's Avatar
    Join Date
    Sep 2008
    Posts
    124
    Credits
    324
    Mentioned
    0 Post(s)

    Default

    I wanna learn Java . All we had in high school were visual basic classes.

  5. #5
    Senior Member ShitFace's Avatar
    Join Date
    Sep 2008
    Posts
    5,025
    Credits
    3,595
    Mentioned
    0 Post(s)

    Default

    lol not bad.

    Now try making it so that the program asks you what you need to write out x amount of times, then does it.
    You could also add a print function.

  6. #6
    FFFFFFFFFFFFUUUUUUUUUUUUU Anonymous D's Avatar
    Join Date
    Sep 2008
    Posts
    3,625
    Credits
    2,705
    Mentioned
    1 Post(s)

    Default

    Quote Originally Posted by Atomic View Post
    First I'd have to beg the teacher to let me type them for educational purposes...
    Yea. because I mean teachers have never heard of copy and paste.

  7. #7
    Merry fucking Christmas Atmosfear's Avatar
    Join Date
    Sep 2008
    Posts
    8,675
    Credits
    2,035
    Mentioned
    0 Post(s)

    Default

    The premise of this thread is retarded.

  8. #8
    Mega Bore Atomic's Avatar
    Join Date
    Sep 2008
    Location
    los Estados Unidos de América
    Posts
    3,267
    Credits
    3,110
    Mentioned
    0 Post(s)

    Default

    Quote Originally Posted by Anonymous d View Post
    Yea. because I mean teachers have never heard of copy and paste.
    I went to school long before copy paste was invented.

  9. #9
    FFFFFFFFFFFFUUUUUUUUUUUUU Anonymous D's Avatar
    Join Date
    Sep 2008
    Posts
    3,625
    Credits
    2,705
    Mentioned
    1 Post(s)

    Default

    Quote Originally Posted by Atomic View Post
    I went to school long before copy paste was invented.
    Then you went to school before computers were invented.

  10. #10
    mutton mutton's Avatar
    Join Date
    Sep 2008
    Posts
    3,707
    Credits
    2,650
    Trophies
    Mentioned
    0 Post(s)

    Default

    mature student

  11. #11
    Mega Bore Atomic's Avatar
    Join Date
    Sep 2008
    Location
    los Estados Unidos de América
    Posts
    3,267
    Credits
    3,110
    Mentioned
    0 Post(s)

    Default

    Anyway...

    It was just a self inflicted exercise. After I posted the first one I read a couple pages over and found a way that is faster and less code. To do the user input will require finishing the chapter I'm on in the book.

  12. #12
    Merry fucking Christmas Atmosfear's Avatar
    Join Date
    Sep 2008
    Posts
    8,675
    Credits
    2,035
    Mentioned
    0 Post(s)

    Default

    Call us when you finish chapter one

  13. #13
    Mega Bore Atomic's Avatar
    Join Date
    Sep 2008
    Location
    los Estados Unidos de América
    Posts
    3,267
    Credits
    3,110
    Mentioned
    0 Post(s)

    Default

    Should I just ring the number your mom gave me or do you live with your dad?

Similar Threads

  1. School life is going downhill?
    By wowzmelissa in forum Personal Support
    Replies: 1
    Last Post: 12-06-2008, 07:33 AM
  2. random old school lws
    By Sliploco in forum Casual Intercourse
    Replies: 55
    Last Post: 12-02-2008, 02:32 AM
  3. Anyone listen to old school funk?
    By jared in forum Aural Fixations
    Replies: 5
    Last Post: 10-02-2008, 11:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •