CMSC 131 C.S. logo
Section 0101  
Web Accessibility  


07/29/18   Project #7 has been posted. This is the last project, so do a good job!

07/19/18   Project #6 has been posted.

07/12/18   Project #5 has been posted.

07/04/18   Project #4 has been posted.

06/25/18   Our first exam is on Thursday 6/28. Be sure to arrive on time and bring pencils with working erasers.

06/24/18   Project #3 has been posted.

06/14/18   Project #2 has been posted.

06/14/18   Lecture slides are being posted on this web site. Click the "Schedule" tab, above, to view them. (You will need to authenticate using the same credentials that you use for the "study questions".)

06/11/18   If you'd like to have Eclipse draw a vertical line in the editor at the 80th column (so that you can easily check that your lines are not too long), see this link.

06/06/18   Project #1 (Orioles Baseball) has been posted! To find the link to the project description, click the "Assignments" tab, above.

05/29/18   We need at least one student to serve as a "note-taker" for a classmate. Please only apply if you are planning to attend every class session, you take good notes, and you have good handwriting. For your service, you'll be paid about $100 at the end of the semester. To apply, or for more information, click this link.

05/26/18   Welcome to CMSC 131 for Summer 2018. Important announcements will appear here as the semester goes on. Be sure to look every day.


This is a first programming course for Computer Science majors with a focus on object-oriented programming. The goal of the course is to develop skills such as program design and testing as well as the implementation of programs using a graphical IDE. All programming will be done in Java.

Course Coordinator: Fawzi Emad

Recommended Text:
There is no required book for this course. There are many excellent introductory books on programming in Java. One that I can recommend is Java Foundations Older editions of this book are nearly identical to the latest edition, and you can find them sold cheaply online.

Major Topics


There will be eight programming projects and other assignments to be completed during the lab sessions.  Some are considered "closed" assignments which you must complete by yourself and others are considered "open" assignments where collaboration is permitted. (More information about the open policy will be provided in class and can be found in the Policy Regarding Open/Closed Projects.) There will also be two midterms, a final exam, and occasional quizzes.


All assignments can be done on the machines of your choice. You are welcome to do the work on a home computer if you have one. There should not be any machine-specific dependencies in your code. If we are not able to run your program because there is a difference between your and our computer environments, you must work with us to get your program to work in our environment.  You are expected to use the Eclipse IDE for all programming assignments.


All assignments must be submitted before 11pm on the day they are due. They are to be submitted electronically according to instructions given with the assignments. Late assignments will be strictly penalized. Exceptional circumstances will be considered only if discussed with the instructor before the assignment is due. Late assignments will have points deducted as follows:

Final grades will be computed according the following weights. (These weights are tentative and subject to future adjustment.)

Percentage Component
25% Projects (8)       [The weights of the individual projects will vary. Longer/harder projects will be worth more points.]
15% Lab assignments (quizzes & exercises to be completed during your discussion sessions)
15% Midterm #1
15% Midterm #2
30% Final Exam

Online Posting of Project Implementations Not Allowed


You need to keep backups of your projects as you develop them. No extensions will be granted because you accidentally erased your project. Feel free to use the submit server as a backup tool by submitting often. You can also use tools like git, etc. Do not post code in any online system that is accessible to others (e.g., GitHub).

Academic Honesty

Note that academic dishonesty includes not only cheating, fabrication, and plagiarism, but also includes helping other students commit acts of academic dishonesty by allowing them to obtain copies of your work. You are allowed to use the Web for reference purposes, but you may not copy code from any website or any other source. In short, all submitted work must be your own.

Cases of academic dishonesty will be pursued to the fullest extent possible as stipulated by the Office of Student Conduct. Without exception every case of suspec\ ted academic dishonesty will be referred to the Office. If the student is found to be responsible of academic dishonesty, the typical sanction results in a special grade "XF", indicating that the course was failed due to academic dishonesty. More serious instances can result in expulsion from the university. If you have any doubt as to whether an act of yours might constitute academic dishonesty, please contact your TA or the course coordinator.

The University of Maryland, College Park has a nationally recognized Code of Academic Integrity, administered by the Student Honor Council.B This code sets standards for academic integrity at Maryland for all undergraduate and graduate students. As a student you are responsible for upholding these standards for this course. It is very important for you to be aware of the consequences of cheating, fabrication, facilitation, and plagiarism. For more information on the Code of Academic Integrity or the Student Honor Council, please visit

Examples of Academic Integrity Violations

The following are examples of academic integrity violations:

Excused Absence and Academic Accommodations
  1. Any student who needs to be excused for an absence from a single class session , due to a medically necessitated absence shall:
    • Make a reasonable attempt to inform the instructor of his/her illness prior to the class. If you are going to miss an in-class assignment then we expect to hear from you (either email or telephone message) before the class session begins.
    • Upon returning to the class, present their instructor with a self-signed note attesting to the date of their illness. The note must contain an acknowledgment by the student that the information provided is true and correct. Providing false information to University officials is prohibited under Part 9(h) of the Code of Student Conduct (V-1.00(B) University of Maryland Code of Student Conduct) and may result in disciplinary action.
    • This self-documentation may not be used for the Major Scheduled Grading Events as defined below and it may only be used for one class meeting during the semester.

  2. Any student who needs to be excused for more than one absence, or for a "Major Scheduled Grading Event", must provide written documentation of the illness from the Health Center or from an outside health care provider. This documentation must verify dates of treatment and indicate the timeframe that the student was unable to meet academic responsibilities. The documentation should be given to the instructor, not the TA. We will not accept a "self-signed" note for "major scheduled grading events", as defined below. The note must be signed by a health care professional.

    The Major Scheduled Grading Events for this course include:
    • Midterm #1
    • Midterm #2
    • Final Exam
    • Programming projects

It is also the student's responsibility to inform the instructor of any intended absences from exams for religious observances in advance. Notice should be provided as soon as possible but no later than one week prior to the exam.

Disability Support Services
Any student eligible for and requesting reasonable academic accommodations due to a disability is requested to provide, to the instructor in office hours, a letter of accommodation from the Office of Disability Support Services (DSS) within the first two weeks of the semester.
Course Evaluations

The Department of Computer Science takes the student course evaluations very seriously. Evaluations will usually be open during the last few weeks of the course. Students can go to to complete their evaluations. 

All course materials are copyright UMCP, Department of Computer Science © 2018. All rights reserved. Students are permitted to use course materials for their own personal use only. Course materials may not be distributed publicly or provided to others (excepting other students in the course), in any way or format.
Exam Dates:

Date Brief Description Lecture Slides
05/29 Course intro; Eclipse demonstration Lecture 01
05/30 Computer Systems (hardware, software), RAM, data storage, programming languages Lecture 02
06/01 Compilers/interpreters, intro to Java, local variables, primitive types Lecture 03
06/04 Strings, concatenation, more about types, Scanner, arithmetic operators Lecture 04
06/06 Escape sequences, integer division, comparison and equality operators, comparing objects, if and if-else statements, logical operators, nesting if and if-else statements, "else if" style Lecture 05
06/08 Programming errors, variable scope and intialization, choosing identifiers, named constants, intro to "repetition" Lecture 06
06/11 While loops, do-while loops, for loops, nested loops Lecture 07
06/13 More nested loops, increment/decrement operators, alternate assignment operators, operator precedence, static methods Lecture 08
06/15 More static methods; Project #2 overview; short-circuiting; casting with primitives; What are objects? Lecture 09
06/18 Java classes; instance variables, instance methods; memory diagrams (reference variables vs. primitives); assignment with references; garbage collection; == vs. equals Lecture 10
06/20 Continue example of "typical" Java class: return statements, constructors, equals method, toString; static vs. instance methods Lecture 11
06/22 Summary and review of variables (local, instance, static); Overview and intro to project #3 Lecture 12
06/25 Code correctness, formal verification, testing, JUnit; Memory diagram for method calls Lecture 13
06/27 Java keyword "this"; Public vs. private visibilities; API; data encapsulation; review for exam Lecture 14
06/29 Commenting; floating point error; packages; libraries; API for String and Math classes Lecture 15
07/02 Break; Continue; Exception Handling Lecture 16
07/06 More exception handling (multiple catch blocks, finally); Arrays Lecture 17
07/09 More arrays: copying, "resizing", arrays of references; Mutibility, StringBuffer, Deep vs. Shallow copies Lecture 18
07/11 Privacy leaks, Two dimensional arrays (ragged) Lecture 19
07/13 Rectangular 2-D arrays; Using the Eclipse Debugger; writing better tests (corner cases); Intro to Java Interfaces Lecture 20
07/16 Java interfaces; polymorphism; wrappers (including Integer, Double, etc.) Lecture 21
07/18 More interfaces; method overloading; ternary operator; switch statements Lecture 22
07/20 Intro to inheritance; polymorphism via extension; overriding vs. overloading; Object class; correct equals method Lecture 23
07/23 Package visibility; Java from the "command line"; Javadoc utility; Overview of abstract data types and Java Collections Framework; ArrayList Lecture 24
07/25 Exam review; ArrayList example; for-each loops; Intro to asymptotic complexity Lecture 25
07/27 Intuition for thinking about asymptotic complexity; Big-O notation Lecture 26
07/30 More Big-O examples; Intro to recursion Lecture 27
08/01 More examples of recursion, including those relying on a "helper" method Lecture 28
08/03 More recursion examples; begin reviewing for final Lecture 29


Fawzi Emad
Office: 3265 A.V. Williams
Office Hours: MWF after class

Teaching Assistants
 Email Responsibilities Office Hours
Arun Srinivas Discussion leader and grader (See table, below)
Carolin Arnold Discussion leader and grader (See table, below)

Office Hours Schedule

Fawzi's office hours are in room 3265 A.V. Williams. Arun and Carolin will have office hours in room 1112 A.V. Williams.

10:00 - 11:00   Arun   Arun  
11:05 - 12:25 Class
12:30 - 1:30 Fawzi Carolin & Arun Fawzi & Carolin Carolin & Arun Fawzi
1:30 - 2:30 Carolin (as needed)        

Online Course Tools

About Java

The following web pages provide detailed references to information about Java.

Setting up Eclipse

In order to complete the projects for this course you must install Eclipse following the instructions in the Eclipse Tutorial. Note that if you install Eclipse from some other source then you will not be able to submit your projects easily!

After you get Eclipse installed, you will need to connect Eclipse to your class account. To the right is a screenshot of the information you will need to enter into the CVS connection dialog box during this process.

You can cut and paste the following lines into the dialog box:

  • Host:

  • Repository Path:
    (Replace "*****" with your login ID.)

Be sure to change the connection type to "extssh", as shown.

CVS dialog

Below are collections of questions and practice problems that are designed to help you to learn the course material. These exercises are not being collected or graded. Answers are provided, but please try your best to solve each problem before looking at the solution! The list will be updated as the semester progresses.

Disclaimer: Your primary resource for studying should be the notes that you have taken during lectures! There will be questions on quizzes and exams that are not in any way represented in this study list. There will be questions on this study list that are not in any way represented on quizzes or exams. Please be aware that exam questions tend to combine more elements into a single question and many of the questions on the list are simpler than questions you will see on your exams. You may discuss these questions openly with anyone, including your classmates. If you are unsure about how the answer to any particular question is obtained, please drop by office hours for help. That's why we're here!

Part 1:  Questions01 Answers01
Part 2:  Questions02 Answers02
Part 3:  Questions03 Answers03
Part 4:  Questions4 Answers4
Part 5:  Questions5 Answers5
Part 6:  Questions6 Answers6
Part 7:  Questions7 Answers7
Part 8:  Questions8 Answers8
Part 9:  Questions9 Answers9
Part 10:  Questions10 Answers10
Part 11:  Questions11 Answers11
Part 12:  Questions12 Answers12
Part 13: Questions13 Answers13
Part 14: Questions14 Answers14


To submit a project, go to the "Java" perspective in Eclipse. Right click on the project folder (e.g., p1) and select "Submit Project" from the pull-down menu. If you do not see the "Submit Project" option then your copy of Eclipse does not contain the class plug-ins. In this case, please see the Eclipse installations instructions on the Resources page, or drop by TA office hours for help.

You may submit many times (we grade only the last submission). You can check the status of your submissions by visiting the Submit Server Home Page and entering your University Directory ID and password.

Important: Your grade for each project will be based on the greater value of two scores: (1) The score on the very last submission prior to the deadline; (2) The score minus 20% on the very last submission prior to the late deadline (up to 24 hours late).

Click the name of a project below to see the project specification.

Project Name Due Date
Hello World! Tuesday 06/05, 11:00PM
Orioles Baseball Thursday 06/14, 11:00PM
Flags of the World Saturday 06/23, 11:00PM
Medieval Soldiers Tuesday 07/03, 11:00PM
Mandelbrot Set Thursday 07/12, 11:00PM
Poker Simulator Friday 07/20, 11:00PM
Cafe 131 Saturday 07/28, 11:00PM
Fish Club Sunday 08/05, 11:00PM