Category Archives: Programming

ICS 22 Project 4

Wow, that sucked. I turned it in at 11:58 and didn’t finish commenting. I had a lot of trouble interpreting the instructions. When time came down to, I just grabbed a working bundle of source and turned it in. I had multiple ones, and while some seemed better code-wise, all but one gave different outputs than that on the website.
The one I turned in first checked if customers should be added to the lines and if so, added them. Then, for each window it did the following checked if there was a customer at the window. If so, it processed him or her. If not, it would move someone from the line into the window. I don’t know if it was right or not.
I did, however, become happy with my clock. If I pass around an int to keep track of time, methods could change it. If I make a clock object with a private int to keep track of time, a public method to change the time, and a public method to retrieve the time, any method could still change the time. So, I made a Clock class with the field/methods described above. Then, I made a ClockView interface that was the same except didn’t have the method to change the time. In Simulation, I did the following:
Clock clock = new Clock();
ClockView clockView = clock;
Now, using the clock reference I could change the time. If I pass the clockView reference to other methods, they can view the time but not change it. Yay!
We’ll see how I actually do.

CSE 22 Project 3

Booya.
Correctness: 10
+) Very well done! You have passed all the tests.
Style: 10
-) When you report a fatal error, it is better to give the line number at
the same time
+) Coding is very clear and well structured.
+) You have handled the execution loop very nicely by having a “keepRunning”
variable in the programState class.
+) Good you have proper comments to give enough information about the
methods.
+) Naming of classes, methods and variables is good.
+) Good you have all fields private.
+) Nice quality of coding.

Project 2

Correctness: 10
+) File is read in successfully!
+) Good you did error checking when user wants to add a voter with the same
SSN as one existing voter. It is the same with polling places.
+) Very well done! Program is correct and robust. I wasn’t able to crash
it or get it to misbehave.
Style: 10
-) It would be better if you print out the voters or polling places in a
nice format.Use the String.format()
+) Very nice user interface! But you can still improve it by giving user
information regarding whether or not his/her operation is successful.
Furthermore, if the list is empty, print something to tell the user about it
if he/she would like to list the voters or polling places.
+) Well structured. Good you broke the go() of VoteUI into several pieces
+) Good you have proper comments
+) Good you have all fields private
+) Good naming for methods/variables
*) A minor thing: I don’t think it is necessary to create a MenuExecution
class since the VoteUI is enough for dealing with command execution.
Furthermore, all the variables related to the operations are all stored in
the VoteUI, it is not necessary to pass all of them as parameters to the
MenuExecution.

Project 3

I think I finished project 3. I’ve never finished early before. Still need to add comments and such though. Maybe do some more testing just to make sure. Yay.
Now I gotta do math hw, reading and a critique by Thursday. And study for Friday’s midterm.

CSE 22 Project 2

Project 2 was pretty fun, but come Monday night, I was stumped. It turns out I was creating new iterators rather than passing around the same one. Then I realized that my linked lists were referenced in two classes, but they weren’t the same linked lists. I fixed everything and finished my commenting at 11:56. Had the whole thing uploaded by 11:57. Two minutes to spare. PollingPlacesReader.java didn’t work though. Oh well… maybe I’ll do better next time.

CSE22 Project 1

Correctness: 9/10
-) You did not deal with negative wages.
-) Your “Please enter employee’s name:” appears twice when I would like to remove an employee.
+) Other parts are well done!
Style:10/10
+) Your interface is friendly
+) Your format of ShowEmployee and DoWeeklyPayroll is nice
+) Naming is good
+) Good you have proper comments
+) Good structured. It is nice for you to break the operations for different commands into different methods.
+) Good you have all fields private