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.
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.
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.
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:
Some exciting upcoming department events: please consider attending!
Here’s the latest version of our Car class that we worked on in lecture today.
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!
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.
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.
Here’s a helpful list of common String methods you may find handy to use in your igpay project.
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.
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:
The first programming assignment of the semester has been posted, and is due at midnight on Thursday, September 11th. Good luck, and ask questions!
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.
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.
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!