44
George Blank University Lecturer

George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 2: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

CS 602Java and the Web

Homework Assignments

Page 3: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Overview• Most corporations require work to be

presented in a standardized format. This document explains my requirements for formatting, as well as listing the assignments

• There will be reading assignments each week, and most weeks will also have a programming assignment.

Page 4: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Assignment Due Dates

• All due dates are given in Moodle. Look for “Assignments” in the menu on the left of the screen.

• The due dates are not the same week as you read the material. This is because I give you at least a week to do the homework.

Page 5: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Presenting Homework• The course is Java and the Web. Each

student must create a web site to display all work done for the class.

• Your web site should have a main menu for CIS 602 with a separate link for each assignment. Each assignment should display your planning document(s), your timesheet, your code, and your executed program, all on a single page.

Page 6: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Web Site Organization

My Web Site

CIS 602Chapter 3Chapter 4Chapter 5a

Homeworkn

Applet

PlanningDocument

Time Sheet

Code

RunningProgram

Your mainMenu page

CIS 602page witha link foreach HW

Each HWshould beon one page.List bychapter number.web.njit.edu/~gblank/

web.njit.edu/~gblank/cis602

web.njit.edu/~gblank/cis602/chapter5

Page 7: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Time Sheet ExampleGeorge Blank T ime Sheet

Date Time Task Time Spent (hrs)12-Sep-05 9:30 AM Read Text and Lecture 1.013-Sep-05 8:30 AM Set up Java environment 0.5

9:00 AM Plan code 0.51:00 PM Write Java Code 1.0

14-Sep-05 10:00 AM Write HTML and Applet container 0.52:00 PM Install and test code 0.5

4.0

Page 8: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Format

• Your applet, planning document, timesheet and code should be displayed on a single HTML page. There are utilities available on the Web that will convert Java code to HTML and pretty print it. See http://www.java2html.de/applet.html Java files are not acceptable, as my systems default to executing them, not to viewing the code. Since most of the code is provided for you, you must clearly identify code you have added or modified, preferably in a different color, but obvious comments are permissible.

• Except for chapter 4, your code must execute in an Applet.

Page 9: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Linking to Moodle• You must post a link to your homework in Moodle.

The Moodle edit window shows a chain symbol that lets you create a hyperlink to your Web page. Since I do all my grading from Moodle, this is how homework is submitted.

Page 10: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Late Assignments• It is career suicide to get a reputation for being

chronically late in the corporate development world. All homework must be turned in on time. Test all your links and make sure they work.

• If I have problems running your homework, you have one week to correct the problem. I will also grade any late assignments on that second week. Two late assignments make you ineligible for a grade of B+ or A. You can only get B or lower.

Page 11: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Work Load

• The standard for graduate classes is two to three hours of work outside class for each hour in class. You should expect to put in at least eight hours of work on the average homework assignment, and about thirty hours on the project.

Page 12: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Cheating on Homework• A large number of students have been

copying assignments from other people, sometimes taking them from a Web site without asking. I have been getting complaints from the honest students. For that reason, I want you to personalize your code, especially in the comments. As soon as you learn how, start putting your code in a .jar file.

Page 13: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapters 1 and 2• Read Chapters 1 and 2 in the text and the lectures

assigned in Moodle.• Create your Web Site and main menu structure.• Set up Java and Eclipse on your system and work

your way through the Eclipse tutorial. Note: You can use another IDE if you prefer. JEdit is also popular, although it is not strictly an IDE. Hardcore Unix folks may use their normal development tools and editors; EMACS is available for Unix, Linux and PCs. The Java IDE can come with NetBeans, but if you are not already familiar with it, use Eclipse. I prefer tools that integrate JUnit and Javadocs into your environment.

Page 14: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Installing the JDK and Eclipse

• Get Eclipse from http://www.eclipse.org. To install it, just unzip the file with pathnames to a directory of your choice.

• Eclipse has an option to get it with Java. Otherwise, you can get the latest JDK from http://java.sun.com. Follow the instructions there to install it.

Page 15: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 3Hello World

• Read Chapter 3 in the text and the lectures assigned in Moodle.

• Programming assignment. Prepare a Hello World program similar to the “Hello from Venus” one in the text, but make it your own by customizing the size, text and image. This homework will not be graded.

Page 16: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

On Line Help

• The text author’s web site is at http://se.cs.depaul.edu/Java/ .

• You can download code examples there. Many of the exercises require you to modify the examples in the text.

• Some students may find that they learn better by typing the examples. I leave that decision up to you.

Page 17: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapters 4-12• Assignments for these chapters are taken from the exercises

in the text book.• Programs should be posted on your web site so that I can run

them as applets. However I accept screen shots of applications.

• Any documents or test cases must be viewable on your web site.

• For some work, you may have to post screen shots to prove you did the work, especially if you cannot convert an application to an applet.

• List by chapter number, not week number or homework number. Otherwise it is very hard to find the correct homework.

Page 18: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 4Factorial, Files and Packages

• Read Chapter 4 in the text and the lectures assigned in Moodle.

• Do exercises 4.1, 4.2, 4.3, 4.7a and 4.8. As these are applications, your Web site must show screen shots to prove you got them working. For extra credit, get one or more of them working as an applet. (You must use applets or JNLP to get an A.)

• Submit your homework by posting a hot link to it in Moodle for that assignment.

Page 19: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 5aDigital Clock

• Read Chapter 5 in the text and the lectures assigned in Moodle.

• Do exercises 4.9 and 5.4. These must be applets and must work on your Web site.

• Classroom students must bring five copies of their code and a copy of a planning document to class for inspection each week that homework is due.

Page 20: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 5bJavadoc and URL

• Read Chapter 2 in the text and the lectures assigned in Moodle.

• Do exercises 5.2 and 5.3.• Prepare a use case in the format shown in

figure 2.19 in the text for exercise 5.3. I do not want Use Case Diagrams.

• Classroom students bring five copies of the code for 5.3 and one copy of your use case to class for inspection.

Page 21: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 6Implement a Stack, JUnit

• Read Chapter 6 in the text and the lectures assigned in Moodle, including the lecture on JUnit.

• Do exercise 6.3• Prepare JUnit Test Cases for Exercise 6.5.• Do exercise 6.5 as an applet. Show screen shots of your

JUnit tests and results. Your JUnit tests should test all stack functions.

• Classroom students bring five copies of the code for 6.5 and one copy of your JUnit code and output to class for inspection.

Page 22: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

First Exam• First Exam (At home: classroom section will not

meet.)• The exam will be the timed development of an

application. If I am teaching both DL and Classroom sections, different exams will be posted on Moodle on the class meeting day and Saturday mornings to be done that day. In addition to material covered in class, you will be expected to be able to use the java documentation to add features you have not yet studied. See next slide also.

Page 23: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Cheating on Tests• To prevent other members in the class from seeing

your work on the tests, do not list the test in the menu of your Web site. Create a new directory under your public_html directory and put the test in it. When you are done, post a link to your code in Moodle. One week after the test is over, you can add a link to the test in your menu.html or index.html file.

Page 24: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 7Sorting Algorithms

• Read Chapter 7 in the text and the lectures assigned in Moodle.

• Extend exercise 7.6, including a fully dressed use case (see figure 2.19) and implementation as an applet.

• For Part B, choose a color strategy that shows how the sort works, such as giving special colors for current index values (such as hi, lo, and mid in QuickSort on page 292.)

• Classroom students bring five copies of of your Part B code and one copy of your use case to class.

Page 25: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 8Calculator and Zip Utility

• Read Chapter 8 in the text and the lectures assigned in Moodle.

• Do exercises 8.5 and 8.7, with a sequence diagram for one and a communication diagram for the other. Prepare one of the exercises for inspection. Note that to get 8.7 to work on another computer, you will have to use a signed jar file or JNLP. If you cannot do either, provide screen shots to prove that it works for less credit.

• Classroom students bring code and diagram for one exercise to class for inspection.

Page 26: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 9Drawing Pad

• Read Chapter 9 in the text and the lectures assigned in Moodle.

• Implement the Drawing Pad application on your web site as either an applet or using JNLP. Add some features of your own.

• Prepare and document at least one JUnit test case and a planning document for a portion of the code.

• Classroom students bring materials for inspection.

Page 27: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 10Maze Game

• Read Chapter 10 in the text, and the lectures assigned in Moodle.

• Extend the simple maze game on page 477 so that it creates a 4 x 5 maze with 20 rooms and allows me to view the maze on your web site. I should be able to move with the arrow keys and doors should open when you are next to them and press Enter. Sound effects should be used. Create a planning document. Note: Sound is blocked on web.njit.edu. Access your files through http://harp.njit.edu .

Page 28: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Course Project• The most important part of the course is the course

project. It must be an original project, at least 200 lines of code, using an applet for a client, with a GUI layout and event handling, and must be able to save and retrieve data from a database through a server. It must be properly planned with adequate planning documents, developed in an IDE, tested with JUnit, and deployed on a Web Server, preferably on web.njit.edu or harp.njit.edu. Animation, graphics, and sound are encouraged.

Page 29: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 11

• Read Chapter 11 in the text and the lectures assigned in Moodle.

• As soon as you complete the maze game, you should concentrate on working on your course project.

Page 30: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Chapter 12

• Read Chapter 12 in the text and the lectures assigned in Moodle.

• Classroom: Bring planning documents for your project to class for a requirements inspection.

• Distance Learning: Post planning documents for project on your Web site.

Page 31: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Second Exam• Read lectures the lectures assigned in

Moodle.• Second Exam• The second exam will be take home

programming. It may require you to use RMI, Servlets and/or JDBC. Note: The best way to “study” for the exam is to work on your project, using features that might be on the exam.

Page 32: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Final

• The Final for this class is a project, not an exam. A preliminary working version of your project must be posted on your Web site by the last day of classes to qualify for a grade of A or B+.

• The final version of your Project is due and must be posted on your Web site by the date scheduled for the Final exam. Classroom students may present their projects in class on the last day of classes if time permits and they are ready in time.

Page 33: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Planning documents• Any of the following planning documents are

acceptable for this course:– Pseudo code – Chapter 4 only – A fully dressed use case. NO use case diagrams!– An interaction (communication/sequence) diagram.– A JUnit test suite (test-first programming)– Story cards and Class Responsibility Collaboration (CRC)

cards (XP)– Operation contracts (usually for methods)

• Choose the planning documents most appropriate for your code.

Page 34: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

FullyDressedUseCase

Page 35: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Interaction Diagrams

• There are two interaction diagrams—sequence diagrams and communication diagrams. They are equivalent—if you do one in a tool like Rational Rose, it can automatically draw the other.

• A sequence diagram is better for showing the order of operations, while a communication diagram is better for showing the messages for a particular object.

Page 36: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Sequence Diagram

Page 37: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Communication Diagram

Page 38: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

PartialJUnitTestSuiteforQueue

Page 39: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Story and CRC Cards• Story cards and CRC cards are informal tools,

usually handwritten, often used in eXtreme Programming. XP depends on having a SME (subject matter expert) available to provide additional details to the developers as they code.

• Story cards, like use cases, describe a particular scenario for the application.

• CRC cards, one per class, describe the class, its responsibilities, and tells what other classes it collaborates with.

Page 40: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Story Card

Each payroll period, a check and check stub has to be createdfor each employee. Timesheets Supply hours worked andovertime for hourly workers plus sick time and holidays for all workers. Taxes are calculated from tax details,and deductions are computed for Medical Plan, Dental Plan, Retirement Plan, and 401K Plan. A permanentRecord of the Paycheck is maintained in the Pay Ledger.

Page 41: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

CRC (Class Responsibility Collaboration) Cards

Class NameSuperclassesSub-classesResponsibilities Collaborators

EmployeePerson

Manager, Salaried Worker, Hourly Worker

Calculate Pay Timesheet, Paycheck, Pay LedgerTax Details

Manage benefits Medical Plan, Dental Plan.Retirement Plan, 401K Plan

Manage Training Training Record, Certification,Professional License

Maintain records Position, Employment History,Dependent

Page 42: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Note on Story Cards and CRC diagrams

• Story Cards and CRC diagrams are eXtreme Programming methods. XP attempts to speed up development by minimizing formal documentation.

• Therefore, it is best to do these diagrams by hand with pencil and 3x5 cards instead of faking them as I have done in the slides. You can scan or take a picture of your documents and post them on you Web site as a JPEG. I will also accept “faked” materials in the same format as my slides, but they are not faithful to XP.

Page 43: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Operation Contract

Page 44: George Blank University Lecturer. CS 602 Java and the Web Homework Assignments

Bibliography

• Jia, Xiaoping, Object Oriented Software Development Using Java. Addison Wesley, 2003

• Many students submit inadequate planning documents resulting in poor grades. An excellent resource to avoid this is http://www.agilemodeling.com/