CS4B Assignments Will Posted First Week

 

Class will have up to 7-12 on-line programming assignments, labeled P1-P12. Each assignment is worth 10 points, pay attention to due dates on assignment you may hand in assignments past the due date for 1/2 credit. During class discussion students should create an outline, algorithm or set of notes for solving program. Your assignments can be checked one of two ways:

  1. You can hand in hard copies of the assignment before class starts.
  2. E-mail them to me but make sure your e-mail subject header has cs4a P1..P12, where P1..P12 represents the assignment you are sending me.


  Assignment
Due Date
p0 We will be doing this assignment in Class 2nd week: fill in questionnaire, - questionnaire will not be available until 2nd week. Also log on to blackboard, take quiz 1 and if you have not already done so login to lab computers.
Monday 2nd Week
 
P1

Chapter 11 Recursion Page 824 Programming Project 6

 

3rd Week
p2

Write a word count wc program, your program should accept a command line argument specifying the file name and output the number of lines, words, and characters in the file.

Program should also output the absolute path name of the file and if the file is writable, and readable.

3rd Week
 

Come with tentative ideas for Project will discuss tentative topics in class and you will have to post on blackboard.

4th Week
Chapter 12
P3
Programming Project 1 Page 909
5th Week
P4
Programming Project 4 Page 910
5th Week
     
P5

You will be setting up an index page and Java Applet on CIM, assignment will be taken from Chapter 13 - Note P2..P4 are due first.

Complete assignment 1 on Page 938; copy your index.html page to your local public_html directory on CIM. Use FileZilla as the ftp client, Your home page viewable from the Web is http://cim.saddleback.edu/~SBUsername We will be setting up an initial index.html home page in class.

Complete programming project 6 on page 939; add your name as a JLabel field in the Applet; Also add a link or include this Java Applet in your home page.

6th Week
P6

Applet Day 3/10/2008t, implement Applet on your home page, be prepared to discuss it informally in Class for 5 Minutes - 2/28. You may implement someone else Applet, but you must both add enhancements, and credit the work...

Professor Ray Watkins has some good Applet Examples

6th Week
Chapter 14 More Swing Assignment to be assigned next year 2008
  Lots of overseas developers India 8million - Web 2.0 Video age of World Wide Collobaration - Duke Choice Awards Tapestry Web Framework - But Apache Struts is more applicable to this class.  
P7

Worth 15 Points

If you interface to the model correctly this assignment is relatively easy.

Will be discussing MVC (Model-View-Controller) design pattern in class after spring break. MVC is a popular design pattern used in Web Application Frameworks such as Apache Struts.

What you need to do....

  1. Fix the controller make sure it is working
  2. Finish Writing the Model, complete all current op codes, and also change the help system so that it prints out 6 columns instead of just 4 columns.
  3. Verify that your model works correctly by using the main function.
  4. Finish writing the applet viewer and controller.
  5. Write a second viewer/controller using a Java console Application. That includes help mechanism. The console should only output the stack or display when a user enters a D or P - we did the console in class..

HPCalculator Zip File and HP Calculator API . The Zip file consists of these four classes: Op Class, HPCalModel HPCalView, and HPCalController. If unfamiliar with RPN (Reverse Polish Notation) this is an online HPCalculator. note default value for trigonometric functions for the above calculator is degrees. For this assignment you must complete all the operations specified by the operators object array in HPCalModel.

You should test all model additions using the HPCalModel main function. you could also add a textarea that keeps track of all operations. You may want to add a command line keyboard input function that feeds the HPCalModel.

You may write your own model, but you must use push as the public interface, extend stack and return a String. You also need to implement the calculator using the same set of Op Codes, you may add Op codes. but the original Op Code set must remain as is. You could consider replacing the Double class with BigDecimal.

Week 11
 

Casino Examples Sockets/Threads

 

 
P8

Make sure you CIM - Database has both the fruit and inventory table; also make sure you fix the name of grape.

Use phpMyAdmin make sure your tables and username exist.

You will need this database to complete assignments p9 and p15

5/26
P9

Query Web Interface to Your Fruit Database

In assignments P9..P15 (p12..p15 are extra credit for CS4B Spring/08) you will be creating a fruit database Web application.

Create a web page select.jsp. select.jsp should open up and connect to your database created in p8. You should be able to enter any query from the keyboard have the query sent to MySQL and then print out the results.

You may want to use eclipse with glassfish plugin to complete these assignments

You will need to login to cim to write this program. You need to connect to CIM using local host. The program is not that hard most of the work was done in the program database.java.

5/26
P10

Customer Order Page

Write a customer Web Page, that allows a user to buy fruit. You need to populate the HTML Form with the fruit Database contents. When a user executes submit, display a Web Page with an itemized order list and total costs. You will need to update the inventory table.

5/26
P11

Inventory Control Web Page

Write an inventory control program that lets the produce manager, list current inventory and add records to inventory database.

Note you may have to make sure the name --> id is a unique key. This SQL statement 'CREATE UNIQUE INDEX comp ON fruit (`name`);' or use phpMyAdmin to make the key name/id unique.

5/26

P11 is the last Assignment for CS4B Spring/08


All assignments are due by 5/26/2008 11:55PM

P12..P15 Are Extra Credit

P12

EJB - Enterprise JavaBeans

Implement a set of JavaBeans to accomplish all the database I/O requirements in assignment p10 and p11. Either modify your classPath to include javabean or add the JavaBean to a Web Application Archive (WAR). A WAR file is similar to the JAR (Java Application Archive) used for J2SE classes, but includes Web Components.

Update your JSP pages using the JavaBeans. WAR tutorial. Sun Packaging Web Components.

EC
P13

P10 Customer Order Page Modifiications...

  1. Use the JSP session variable to create a Shopping cart.
  2. Add fruit images table or URL links to database - use them in the customer order page
  3. Add a customer username and password table - I would use phpMyAdmin to create the tables.
  4. Add a table to keep track of orders, should have pointer to customer username/password.
  5. To verify password you compare the username and encrpyted password with the database record
  6. Add JSP cookies to remember users.
  7. Send customer an email upon order completion. J2EE javax.mail.
EC
P14

Database trigger

  1. Implement "database trigger" when a customer uses up the inventory on a specific fruit, you need to email your cim account that the item has ran out. Your CIM email account is automatically forwarded to your SB email. A database trigger is often implemented in the PL SQL language. However, for this assignment, just keep an eye on inventory whenever a customer places an order. J2EE has web mailer classes.

Make sure you have your SB email forwarded. I sending out e-mails through blackboard to students.

EC
P15

Finalize the Customer Order Page

  1. Add an application implicit to keep track of number of users login to fruit database Web application
  2. Add a comment field so that a User can comment on a fruit. The comments should be stored in a new MySQL table.
EC
P16 Message passing system, that passes a message to inventory table, that addes new inventory.  
 

Books Considering for CS4B

First Choice

Intro Java $100 Book

complete java reference 7 8the edition not out yet added XML 7th edition

5th edition of Savitch book, dropped swing, more swing and Java Applets. (will need these topics or but 4th edition on reserve)

Need book: networking, threads, sockets, JDBC, J2EE, JSP, JavaBeans, eclipse, glassfish
Other possible topics : mvc, xml, rmi, Web architecture framework (struts);

Plan on Finishing Savitch - Review Chapters 1..12 (2 Weeks) Cover 13 & 14 (4 Weeks) -

Cover JSP 5 Weeks

Java Advance Book - 5 weeks (may not be enough weeks Left to justify another book - Unless scale down JSP)

Other Design Patterns, Eclipse in Action

 
P8

Thread Database Assignment, Will be using the Fruit Database, you will have to write an applet client.

 

 
P9 Socket/Thread Assignment - need to write a bj, or im program uses the main server  
P10 Given JavaBean that access database and return a CSV data, write a JSP Program that accepts this data and translates it to the proper HTML table format. You will need to write a JavaBean that translates from CSV to HTML table format.  
     
Battleship - Term Project
 

Write a Battleship Player, put ships in Corner, just guess randomly.

What is the sequence of message that gets sent to your player when you call:

    1. debugMode()
    2. singleUserTestMode();
    3. headToHead();
    4. tournamentMode();
on TournamentMode you need an array of players, but you can use the same player more than once
Hint 1 - may be done as in class assignment
 

Write your own Battleship player - Implement the method makeMove & placeShips in your PlayerN class, where N is the number you have selected on the signup sheet. You will need to implement messages relative 'Single User Test Mode' and 'Head to Head Combat' Extra Credit: (1) Find Bugs in Battleship Code; (2) Devise significant battleship upgrades; (3) Check with me about adding upgrade on your own (4) Your player exceeds 'Single User Test Mode' 6.0 performance rating.

 
 

In tournament mode, after Head to Head combat is completed, your player will be passed a message IDSeriesRating, this messages signifies that the SeriesRating class is completed. Use SeriesRating.getHead() to get the head pointer of this class, step through the link list, and write your own statistics to disk. You should be creating the private method fileStat. Why is this method private? Keep in mind that PrintSuperClass allows easy file writing. Extra Credit: Come in with a competive player. Able to defeat, Palomar Hall of Framer (14-15 Year Old or First Student to Defeat Me), be a top class player or defeat my pride and joy AceInTheHole; Extra Credit: (1) Find Bugs in Battleship Code; (2) Devise significant battleship upgrades; (3) Check with me about adding upgrade on your own

 
  Using the head pointer to SeriesRating.getHead(), write a recursive routine that steps thru each link node in the list. Your program should read the number of win vs losses for the series. Using PlayerSkill statistics (methods) you should be able to determine, if the win loss of the series correctly represents the players capabilities. For this assignment you can also use the battleship code to read the files PerformanceRating.dat and SeriesRating.dat, these two files represents statistics from the tournament mode on our web-site, you don't need to write a player of makeMove to read these files, simply use bpi to determine how to read these files. After you have written a program for interface to the battleship class, write a short synposis on any unusually findings in the last tournament mode.  
  Write a frame interface for Battleship, either for DebugMode or Tournament