Last time, we played with a simple memo pad application and imagined what the program might contain. Today, we look at the code itself and begin to learn a little about Java and a little about object-oriented programming.
After studying the memo pad program, each of you wrote down at least three questions you have about the code. Pair off with a classmate and share your list of questions. Assume that I will answer only one question from both lists. Pick the one you want answered today.
Open MemoPad.java in Dr. Java. Take questions.
Some of the big questions: ...
Compiling and running a Java program.... javac and java. Dr. Java: interactions, comments.
Some design principles:
Here is a simple class diagram:
Last time, we considered some possible changes and extensions we might make to the program, including:
Work with your partner to determine which parts of the code we would we have to change in order to implement each.
Do any of the changes require that we change multiple classes? Do any of the changes require that we change a class's interface? If yes, then we may be able to improve the design of our program.
Java and object-oriented programming.
Answer more questions about the vocabulary in the memo pad program.
We will be defining terms and looking at what they mean throughout the course. Please ask questions about any term that confuses you, or any jargon that shows up unannounced.
That's one of the most important things you can do in order to succeed in this, or any, course: Ask questions.
We talked about another last time: Read.
Read. Read.
There is at least one more thing you should do: Practice. Linux. Java. OOP.
The Pop Quiz. I asked you to...
Write a program that repeatedly reads in integers, until it reads the integer -1. After seeing -1, it should print the average of the integers and terminate.
The verdict:
The Survey. I haven't processed all the data yet, but I did tabulate answers to one of the questions:
What is the most interesting program you have ever written for yourself (not for a class)?
I was curious: Who among you programs for him- or herself -- for fun? (I envy you your access...)
The results were interesting and occasionally surprised me:
I was not surprised that this number was so high. I'm actually surprised it's so low.
I'm not surprised. We all like to have fun, and fun is a powerful motivator to make things.
This isn't quite what I was looking for, but it does say something about how many students get to program on the job -- or use there skills to solve a problem they face.
Wow.
We have a wide range of experience in the class. That is good. Many of you will be able to learn from your classmates. The more advanced among you can appreciate the complexity of writing large programs. I hope that you learn some things this semester that help you do it better.
What about me? It's only fair that I answer as my 18-year-old self. [I was a chess player. Scoresheets. Rating system for club. Chess itself. Tournament pairings.]
I have been programming a long time. I still have a lot to learn.
Being able to program makes you powerful. Writing programs can also be fun. One of my goals for this course, and for your undergrad education, is this: You become a programmer who is competent and confident enough that, whenever you think, "I wish I had a ..." or "I bet I could ...", you can.
If you don't have a computer, or do and prefer not to install Java there, you can do your programming on one of the computers in the labs, or by logging into student.cs.uni.edu. Let me know if you have any questions.
Here is a list of the actual programs that you are your classmates listed on the survey:
You are an interesting group!