CPSC 240

  • Syllabus
  • Office/Tutors
  • Readings
  • Assignments
  • Homework posted!

    This lil’ homework should be relaxing and fun for you, and can be viewed as “the calm before the storm.” (The “storm” is programming assignments #2 and beyond.)

    Good luck, adventurer! This little 10-pointer is due next Friday at midnight.

    Sep 13

  • Hint: reading an entire line of input

    If you’ve instantiated a Scanner object, like so:

      Scanner input = new Scanner(System.in);
    

    then you can read an entire line of input from the user this way:

      System.out.print("Where do you want to go today? ");
      String destination = input.nextLine();
    

    Now, if the user types “New York City“, the value of the destination variable will be “New York City“.

    However, if you do this instead:

      System.out.print("Where do you want to go today? ");
      String destination = input.next();
    

    (stare carefully to see the difference) then Java will only read the first word of the input, and leave the rest dangling on the input stream for later. In this case, the value of destination will be “New“.

    Strange but true.

    Sep 11

  • Crazy in-class example

    I have posted the code for today’s crazy in-class activity to a github repo. This is the “normal” way to share code, and the way you’ll be doing it all semester with your team.

    To get the code, cd to whatever directory on cpsc.umw.edu you’d like to put the code in (you can create a new directory for this purpose if you’d like) and type this command:

    $ git clone git@github.com:divilian/CrazyInClassExample.git
    

    This will clone my repo in your local workspace on cpsc. You can then cd into the directory it made (CrazyInClassExample) and see, compile, and run all the code.

    You might ask, “in general, how does one know what to put after the “git clone” part? Answer: on the repo’s home page, click the green box that says “Code” and copy the link in the “SSH” tab. That’s what you paste immediately after typing “git clone“.

    (Btw, if you don’t have your github SSH keys set up like Ian specified, you’ll instead choose the “HTTPS” tab, and paste that URL after “git clone” instead.)

    Finally, the answer to the activity is:

    Yoduh May duh 4S B which U!
    Sep 10

  • Department events

    Some exciting upcoming department events: please consider attending!

    • Monday = CyberClub Interest Meeting @ 6:00 in HCC 111
    • Weds = GMU Accellerated Grad Program Info Session @ noon in Farmer 041 (free pizza)
    • Weds = UMW CPSC/CYBR Internship Panel @ 4:00 in Farmer 036
    • Thurs = DiverCS Trivia Night & Snacks @ 5:00 in Farmer 054
    Sep 8

  • Latest Car code posted

    Here’s the latest version of our Car class that we worked on in lecture today.

    Sep 8

  • Responsive reading posted!

    The next homework due (after “igpay“) is a thoughtful written response to a book section and article I have posted. All the details are here. It’s due to my manila folder at 5pm on Monday Sep 15th. Send questions!

    Sep 7

  • IMPORTANT clarification

    The purpose of the first programming assignment is for you to get used to using the Linux CLI (command-line environment) with vim and git and javac.

    Therefore DO NOT use NetBeans, IntelliJ, Eclipse, or any other IDE to complete this assignment! That would be a complete waste of time.

    My purpose isn’t to test that you can write basic Java code. I already know you can write basic Java code, otherwise you wouldn’t have the prerequisites necessary to get into this course. My purpose, instead, is to help you get up to speed being productive in a CLI.

    Sep 3

  • Lab Aide hours

    A number of talented lab aides are at your disposal this semester for help with your understanding in learning how to program! I’ve put their names and weekly date/time/locs in the office hours tab.

    Sep 1

  • Stupid string tricks

    Here’s a helpful list of common String methods you may find handy to use in your igpay project.

    Sep 1

  • Saturday’s homework

    If you didn’t turn in the homework due Saturday on time, you forfeited the one point it was worth, which of course isn’t much. However, you still have to do this homework! If you don’t, you won’t be able to do much of anything else in the class.

    Sep 1

  • Accommodations

    If you’ve received an accommodation letter from the ODR, and sent it along to me, thank you very much. Let me be specific about how I will handle all of these:

    1. I fully intend to comply with all your accommodations, but I may need to be periodically reminded on a case by case basis. If I do end up needing reminding at any time, please don’t interpret that as “Stephen doesn’t care about me or my accommodation.” Instead, interpret it as “Stephen has a lot of things he’s trying to carry in his mind right now, and it’s hard for him to memorize everybody’s accommodation needs at all times.” Please do just gently remind me, and I’m happy to accommodate.
    2. For accommodation needs like “the ability to record the lecture,” that power is officially granted to everybody. Heck, you can even stick the recording on Youtube if you want.
    3. For accommodation needs like “a distraction-free environment for quizzes,” please tell me at the beginning of our first quiz that you need this, and I will relocate you to another room for the quiz.
    4. For accommodation needs like “extra time on quizzes,” I’ll also have you in the distraction-free room, and give you 1.5x or double time or whatever your accommodation awards. Do be aware that this will mean missing some class time (since class on Fridays will begin immediately after the regular quiz time, so if you’re still working on it you’ll miss those minutes of lecture). Usually, that time will probably be spent going over the questions on the quiz, so you shouldn’t miss much, if any, new material.
    5. For accommodation needs like “access to a laptop to take notes,” please let me know this in class Wednesday so I can relocate you to the back/side of the classroom (where others won’t be distracted by your screen).
    6. For anything else you think I need to know about, just come ask me: email, after class, and office hours are all good.
    Aug 29

  • Program #1 posted!

    The first programming assignment of the semester has been posted, and is due at midnight on Thursday, September 11th. Good luck, and ask questions!

    Aug 27

  • Enrolling in CPSC 225

    CPSC 225 currently shows “full/overenrolled” on Banner, but that’s just because Dr. Finlayson wants to be notified when people join so he can set them up on the server.

    So: if you haven’t previously completed CPSC 225, and you’re not currently registered, please send an email to ifinlay _AT_ umw _DOT_ edu and ask to be added.

    Aug 26

  • Summer email

    Here’s the essence of that June 2nd email I sent to the class:

    As the summer months truly begin to set in, and you get into the rhythm of your break from classes, I’d like to interject a dose of reality. If you’ve had me in class, you’ve heard this spiel before. If not, then allow me to highlight some incontrovertible facts of the universe:

    Computer programming, like playing the piano or marathon running, is an activity that requires consistent practice in order to perform at a high level. There’s simply no way you can practice your instrument dutifully for three months, then take three months off, and not suffer a major degradation in your skills. Similarly, there’s no way to train like an Olympian for three months – running 15-20 miles a week – and then take three months off without losing nearly as much stamina as you’d gained.

    Your body simply doesn’t work that way. And it turns out, neither does your brain. (If you didn’t realize this, your brain is actually part of your body! And it obeys all the same physical rules.)

    Every variable you declare, function you call, and while-loop you write strengthens the logical component of your mind that you need for programming. It develops and reinforces those patterns you’ll need to rely on in the trenches, when your frontal lobe is allocated to contemplating larger concerns like architecture, design, and strategy.

    …When I begin the first lecture on August 25th at 11am, I’ll be assuming you have mastered the Java material in CPSC 220 and are ready to climb higher from there. I will not be spending the first month or two reviewing the 220 material and trying to wake you back up from your coma.

    Aug 25

  • Welcome!

    Greetings, and welcome to the fall 2025 edition of CPSC 240: Object-oriented Analysis & Design with Stephen!

    This site is gonna be hip-hoppin’ with all kinds of great stuff real soon, so stay tuned!

    Aug 12

CPSC 240

CPSC 240

stephendavies.org