CSCE 155
Fall 2005
Assigned: August 29, 2005
Due: September 12, 2005
Note: This assignment is to be completed individually - collaboration is strictly prohibited.
Points: 100 points
Objectives
The objectives of this homework assignment:
Problem Description
The
planet Tatooine has a factory that builds fighter planes for the rebel forces. There is no quality control on the production
of these fighter planes and the Tatooine
Pilot Safety and Testing Council finally decides to institute a
sophisticated pre-flight testing system.
The Chairman of the Council has dug up some old programs (written by an
Ewok named Half-Baked, see picture) and realized that these programs are
incomplete. As the Council’s chief
programmer, you have been tasked to complete these programs.
A fighter plane is a complex system and to build a complete pre-flight testing system within two weeks is impossible (that’s why Half-Baked quit the job in the first place!). So, the Council wants you to concentrate on only three systems: the operating system, the navigation and the weapon systems.
As the Chief programmer, you are required to approach this task using the Object-Oriented Programming (OOP) paradigm. The operating system, the navigation system, and the weapon system are all objects. (Can you think of any other objects in a fighter plane system?) To instantiate these objects, you need classes (or molds/templates). The three programs that the Council has given you are three classes, Os.java, Navigation.java, and Weapon.java, to represent the three aforementioned systems.
The Os.java class has a “main” method. This is very important. It allows the user to run the program. So, a pilot can actually run this operating system program. (Note that Navigation.java and Weapon.java do not a “main” method and thus they cannot be run as an application directly.) Thus, sometimes we call a class like Os.java an “application” class since it can be run as an application.
A sample run of the program is shown below. (Note: Bold texts are user input.)
|
Sample Output (Weapons System Test) |
|
Welcome to RZ-1 A-wing Starfighter Operating
System. You can test this plane using this system. Please choose from below: 1 for testing the Navigation System 2 for
testing the Weapons System Your
Choice: 2 Testing the Weapons System... Primary
Weapon: Four Laser Canons Secondary
Weapon: Two Proton Torpedo Launchers Firing
Primary Weapon: !!!!!!!!!!!!!!!!! Primary
Weapon working Firing
Secondary Weapon: ********* Secondary
Weapon working Weapons System is in working condition Weapons System Test Concluded Good bye! May The Force Be With You! |
Supplied Solution Components
You can download the partially completed programs (Os.java, Navigation.java and Weapon.java) from the course web page. To work on the project, open Os.java, Navigation.java and Weapon.java in the Homework1 folder using jGrasp (or an IDE of your choice). The Os.java program has a main method which allows you to run the operating system. It is imperative to know that some methods and data members may be missing and/or some supplied methods and data members may not be useful. Read the programs carefully. Your job is to insert the missing functionality, provide correct documentation (use the javadoc style), and ensure a working program.
You need not be concerned with how to read input from the keyboard – this part of the program has been implemented in the readInteger() and the readString() methods supplied with the program. Note that import java.io.* is required in both Os.java and Navigation.java since both print out messages to the screen.
Challenge - Extra Credit (10 points)
Modify your program to add a feature that allows a user to be able to test the Navigation System and the Weapon System without restarting the program. Currently, after you are done with one option, the program terminates. It would be nice that the program asks you whether you want to quit the program, or continue for testing another component of the plane.
Submission Procedure
This assignment is due on September 5th, 2005 at the start of class (2:30 PM). Assignments five minutes late will not be accepted. It is highly recommended that you read the grading policy and grading guidelines on the course website for a complete explanation of how the assignments will be graded. Remember, your program should follow a good programming style, include plenty of comments, and perform all of the functionality outlined above. Also, in the welcome message of your program, state whether you are implementing the extra credit functionality.
After completing the assignment, you must “handin” the following files on-line:
1. Source files: Os.java Navigation.java Weapon.java
2. Compiled files: Os.class Navigation.class Weapon.class
3. Readme file: README
4. Testing file: TEST
In addition, you must submit a stapled paper copy of your source code (and README file, and TEST file). Both of these steps must be done by the start of the class on the day the assignment is due. Together with your paper copy, you must attach a coversheet. (Please download this coversheet from the instructor’s course website, under the Homework Assignments link.) This coversheet allows the grader to give comments and categorize the points for your homework.
Additional Information
The README file should contain information about all the files that you hand in. List the files, and describe each file in terms of whether the file is a program or a text file, the objective of each file, and so on. The README file is also part of the files that you hand in too! Further, the README file should contain information about how to compile your programs and how to run your programs. It should also contain information about your testing results.
In the future, as your program becomes more complicated, you will have to also include the hierarchy of the files, the call-links of the files, and so on.
For testing, capture the screen output for your various tests. Show the interactions that display the testing of the two components. Show the interactions that demonstrate the robustness of your program (for example, by inputting an invalid response). If you turn in the extra credit portion, also show the interactions that demonstrate that your program accomplishes the additional features. Basically, the testing should show that you are confident that your program works convincingly.
If you do not know how to capture
the screen output, please go to the