COMP101 PRACTICAL EXERCISE 4 - TRIANGLE RECOGNITION

(Week 7 Starting Monday November 6th 2006)

Hand in date - one week after your scheduled tutorial session in week 7.

Aims and Objectives: Provide an opportunity for students to apply their knowledge of the "if-else" construct taught in week 6.



1. REQUIREMENTS

Produce a Java program which, given three sides of a triangle, determines whether the triangle is:

  1. Equilateral - all sides the same length,
  2. Isosceles - two sides the same length or
  3. Scalene - no sides the same length
TRIANGLES

Figure 1 Differentcd types of named triangle

Assume that any individual side must be a positive number not greater than 100.0.

Note: You might find it useful to look at the notes on choice points and the Java "if-else" statement presented in week 6.



2. REPORT

You should prepare a report comprising the following sections:

  1. Requirements: (outline of the above requirements)
  2. Analysis: Your analysis of the problem comprising: (i) a Class Diagram outlining the proposed class structure/hierarchy, and (ii) a set of summary tables describing the fields, constructors and methods for each class you intend to create.
  3. Design: Detailed designs for the methods you intend to include, described using Nassi-Shneiderman charts, and a high-level Activity Diagram describing the "paths" through your code.
  4. Implementation: Your Java source files.
  5. Testing: A set of appropriate test cases covering both arithmetic and path testing together with the output from your program as a result of running these test cases (refer to your Activity Digram when drawing up your path testing cases).

All supporting documentation (i.e. excluding your Java source source files) should be prepared as a single Microsoft Word file. Once completed you should "up load" your Java source files (extension .java) and your word document to the CS department's electronic "practical assignment submission" system.

Remember the guidance notes for COMP101 practicals.



3. MARK SCHEME

90% of the marks will be distributed evenly between: Analysis and Design; Implementation; and Testing. The remaining 10% will be awarded for "overall presentation".




Created and maintained by Frans Coenen. Last updated 30 October 2006