CMSC 131
Section 0101

08/05/15   The final exam will be on Friday 8/7 from 11:00AM to 1:00PM. Note that this is 40 minutes beyond our usual class time. If you are unable to stay the extra 40 minutes due to an unavoidable conflict, please email me immediately to let me know exactly what the conflict is. If it is a truly unavoidable conflict then I would allow you to start the exam at 10:20AM and finish at our usual class ending time of 12:20PM.

08/05/15   The complete set of slides on inheritance is here. (Use the same login ID and password that you use to view the study questions.)

08/01/15   The first part of the lecture slides on inheritance are available here. The rest will be posted on Wednesday. (Use the same login ID and password that you use to view the study questions.)

07/30/15   Project #7 has been posted.

07/28/15   There seems to be a growing trend of students arriving late for class (both lecture and discussion). This is disruptive for your instructor, TA, and classmates; also, it's much harder for you to learn the material when you are late for class. Please arrive on time every day.

07/20/15   Project #6 has been posted. This project is due just before the second midterm, so please do not procrastinate on this one!

07/13/15   Project #5 has been posted.

07/10/15   Regarding the JUnit tests for project #4: The file that I included with the project distribution was a bit old -- it uses JUnit 3 style tests instead of JUnit 4. This means that you do NOT need (or want) the @Test annotation above the tests. Sorry for the mistake. On subsequent projects we will be using JUnit 4 exclusively.

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

07/02/15   Next week we will be (again) switching the discussion rooms around (Neal's students will be moving too this time). Please see the schedule for details.

07/02/15   Please remember that campus is closed tomorrow (Friday) so class is canceled. Enjoy the long weekend!

06/25/15   Project #3 has been posted. Note that this is a closed project so no collaboration is allowed. Please review the course policy on open/closed projects.

06/17/15   Project #2 has been assigned. This project is a lot more work than Project #1, so please get started immediately.

06/13/15   There is a way to have Eclipse automatically draw a vertical line in the editor at exactly the 80th column. (That way you can easily check that your lines are all less than 80 characters long, which is a requirement for project submissions in this course.) Try this: Right-click inside the editor, then choose Preferences, General, Editors, Text Editors. You'll see a checkbox called "show print margin". Check this box, and enter the value 80 in the box below that says Print margin column.

06/10/15   Project #1 has been posted. (Click the "Projects" tab to see the project description.) It is due in a week, so get started right away!

06/10/15   More study questions have been posted, and I will continue to post them as we go along. Check back often for new questions! The login ID and password for the study questions was announced in class -- email me if you don't have it.

06/02/15   Project #0 has been posted and is due by Monday 6/8. To see the project description, click the "Projects" tab in the menu above. This project is trivial, but still worth 1% of your course grade, so be sure to get it done.

05/31/15   All lectures (MWF) will be held in room CSIC 3117. Due to scheduling constraints, the Tues/Thurs discussion sessions had to be spread out across multiple rooms. Please see this schedule for further information.

05/31/15   Welcome to CMSC 131 for Summer 2015. Important announcements will appear here as the course moves along. 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
  • Intro to Computer Systems
  • Programming Basics:  Variables, Operators, Expressions, Statements, Methods
  • Java Text Input/Output
  • Conditionals
  • Loops
  • Principles of Object Oriented Programming
  • Basics of Program Design
  • Testing and Debugging
  • Java Memory Map
  • Arrays and Java ArrayLists
  • Java interfaces
  • Inheritance
  • Polymorphism


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:

  • 20 points are subtracted from your total if submitted within 24 hours.
  • No late assignments will be accepted after 24 hours.

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

40% Projects (8)       [The weights of the individual projects are: 1%, 3%, 5%, 5%, 6%, 6%, 7%, 7%]
15% Lab assignments (quizzes & exercises to be completed during your discussion sessions)
11% Midterm #1
11% Midterm #2
23% Final Exam

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

To further exhibit your commitment to academic integrity, remember to sign the Honor Pledge on all examinations and assignments: "I pledge on my honor that I have not given or received any unauthorized assistance on this examination (assignment)."
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. 

Exam Dates:
  • Midterm #1: Thursday 7/2 (in discussion section)
  • Midterm #2: Thursday 7/30 (in discussion section)
  • Final Exam: Friday 8/7 (in lecture)

Fawzi Emad
Office: 1201 A.V. Williams
Office Hours: MWF (After class)

Teaching Assistants
 EmailResponsibilitiesOffice Hours
Neal Gupta Discussion Leader (Group A) Tu/Th 12:30 to 1:20 (room 1112 A.V. Williams)
Pouya Motakef Discussion Leader (Group B) Tu/Th 10:00AM to 10:50AM (room 1112 A.V. Williams)
Online Course Tools
  • Grades Server. This is where you go to see grades on assignments and to get your class account informtion.
  • Submission Server. This is where you go to view your project submissions and to get limited feedback about how your project is performing on our automated tests.
  • Eclipse Tutorial. Eclipse is an Integrated Development Environment (IDE) that helps us to write software efficiently. You will use Eclipse to implement the class projects this semester. See the section at the bottom of this page for specific information about setting up Eclipse.

About Java

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

  • Oracle's "Code Conventions". Guide for proper style when programming in Java.
  • Oracle's Java Homepage. This is the place to come when you really need the latest technical specs and downloads.
  • Oracle's Java Tutorial. This page has a number of links to books and web pages about Java, which you may find of interest.
  • Java SDK 6.0 General Documentation. This page contains technical documentation for the Java Software Development Kit (JDK), which includes the Java compiler and the associated libraries.
  • Java 6.0 API Specs. This page contains (javadoc) documentation for the Java libraries. It is an excellent reference and you should bookmark it on your browser.

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:  Questions Answers
Part 2:  Questions Answers
Part 3:  QuestionsAnswers
Part 4:  Questions Answers
Part 5:  Questions Answers
Part 6:  Questions Answers
Part 7:  Questions Answers
Part 8:  Questions Answers
Part 9:  Questions Answers
Part 10:  Questions Answers
Part 11:  Questions Answers
Part 12:  Questions Answers
Part 13: Questions Answers
Part 14: Questions Answers

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! Monday 06/08, 11:00PM
Orioles Baseball Wednesday 06/17, 11:00PM
Flags of the World Thursday 06/25, 11:00PM
Medieval Soldiers Sunday 07/05, 11:00PM
Mandelbrot Set Monday 07/13, 11:00PM
Poker Simulator Monday 07/20, 11:00PM
Cafe 131 Wednesday 07/29, 11:00PM
Fish Club Friday 08/07, 11:00PM