600.107 Introduction to Programming in Java
Spring 2013


Warm-up Assignment #7
Due: 6pm on Monday, 4/8

Part A: (ungraded) (Same as last week.) Read Chapter 10. Do exercises 5, 7, 11, 15. Write and run a JAVA program to check your answers. You are permitted to work together on any ungraded work for the course.

Part B: [10 pts] This week's warm-up involves the second phase of programming: solution design. To begin, carefully read the problem description below. Then create an object oriented design for your solution. This requires you to identify how many different classes will be useful, and what types of objects they will be used for. Some may already exist, several you will need to write. Don't forget to include a main driver class. (Hint: focus on the dominant nouns in the description and think along the lines of our Card/Deck system or the Student/Course example.) Write a description of the purpose of each class. Also include a list of the data members each will hold, and the methods in each class. Name your variables and methods descriptively so that their purposes are obvious. You do not have to include javadoc comments or actual method definitions at this point. Name this file "w7.txt".

A solution to the warm-up will be posted on Monday to aid in completing the programming assignment. Your java solution will be required to use my object oriented design solution as a starting point for your program (so don't write the full program yet!).


Programming Assignment #7
Due: 1pm on Wednesday, 4/17

Part A: Experimental Results [60 pts]

The purpose of this assignment is to provide a comprehensive set of classes and operations to build and manipulate a collection of scientific experiments. Each experiment will be a timed transformation from one solution to another by introducing some type of agent. Hopefully you can imagine many different situations which would produce results in this generic form. There will be two types of input for the program. One type will be plain text data files containing the results of many scientific experiments. The other type of input will be a transaction file containing a sequence of queries to find out particular types of information about the results, such as what was the average time to get from solutionA to solutionB, or to list all the experiments that used a particular agent. Reading and processing this transaction file will guide the main activities when you run the program.

[6] You must create at least two sample input files for running and testing your program and submit them with your source code files - one data file and one transaction file. Each data input file can contain the results of any number of experiments. The data for each experiment will be all on one line of a file. Specifically, the data will consist of a start time, an end time, the starting solution, the final solution, and the agent. The solutions and agents will be strings; you can assume they do not contain spaces. The start and end times could be in either standard or military format, but must not contain spaces either. Here are a few examples:

9:30am 10:15am SolutionA SolutionB Agent1
1440 2204 ice water heat

[6] At the start of your program, prompt the user for the name of the transaction input file. Also create a variable that will write the processing results to a plain text file called "output7.txt". Lastly, make a relatively small collection that could hold the results of 10 experiments. Your main program should then process the entire transaction file, one line at a time. For each input line, write the transaction request to the output file, followed by any results it produces. Separate the output for each transaction from the next with a blank line.

The transaction input file will contain a sequence of operation requests, one per line. Each line will start with a single letter code from the list below, followed by any data that transaction needs to do its job. Here are the transactions; you must use the given character code as the menu selection input:

For any operations that you do not successfully implement, write "transaction type not supported" to the screen each time they should be executed.

[6 pts] You must do a truly object-oriented solution with multiple classes using the breakdown I provide in my solution to w7 as a starting point. You may not use any Java API collection classes such as ArrayList or Vector! Instead, manipulate your own arrays within classes to implement. (String is always allowed.) You may and should reuse code from lecture examples, being sure to include comments citing the original source. You must continue to include proper javadoc style comments on all methods (except main). Don't forget your header on every file, and a reflection in your file with main.

[2] You must zip all necessary source code files and two sample input files together when you submit on blackboard. You must submit all *.java and *.txt files that are necessary to compile and run your solution together in your final submission attempt! Don't forget to include any source code files from lecture examples.


General assignment requirements, style and submission details: