App01 Distance Converter - BNU-CO453/ConsoleApps15 GitHub Wiki

App01: Distance Converter

Description

This App allows the user to convert distances measured in one unit of distance into another unit of distance, for example it will convert a distance measured in miles into the same distance measured in feet.

User Requirements

Basic Features (45%)

The application should:-

  1. Output a heading with the name of the application and the name of the programmer.
  2. Input any valid distance measured in miles
  3. Convert that distance into feet
  4. Output the equivalent distance in feet
  5. Input a distance in feet and convert it to miles
  6. Input a distance in miles and convert it to metres

The input and output should accept numbers that include the decimal point.
This app can use the fact that 1.0 miles is exactly 5280 feet.
This app can use the fact that 1.0 miles contains 1609.34 metres

Advanced Features (75%)

To develop these advanced features the whole application needs to be refactored and needs to make use of a static library class in order to avoid a serious amount of code duplication.

The Application should:

  1. Prompt the user to select which unit to convert from (Miles, Feet or Metres)
  2. Prompt the user to select which unit to convert to (Miles, feet or Metres)
  3. Convert the from distance entered into the to distance using the selected units.
  4. Output the distance in the to distance units.
  5. Output an error message when an invalid distance is entered
  6. Output an error message when an invalid unit choice is entered

Outstanding Features (>=85%)

Only one of the the following features is required to achieve an outstanding application

  1. A Mobile Phone App version of the distance converter or
  2. A console version that offers a choice of at least 6 different units of length (See Unit Converters)

UML Design

Activity Diagram

The student should replace this diagram with their own activity or use case diagram using a different colour other than blue. Activity Diagram

Class Diagram

The student should add a Class diagram of their completed App01 here

Required Screen Shots

Screen Shot 1

One Sample Conversion with valid data The student must replace this screen shot with a similar one containing their name.

Screen Shot

Screen Shot 2

Entering an invalid distance. This should show a user entering an invalid number (a negative number or a number containing letters or symbols) and the system display a sensible error message and prompts the user again.

Screen Shot 3

Entering an invalid choice of distance unit. If choices of distance units are 1 to 3 then entering 4 should lead to an error message and a repeated request for a choice.

Screen Shot 4

Screen shots showing that the outstanding features are working

Feature Testing

Unit Testing (50% of Testing)

For the advanced features there should be 6 unit tests and the screen shot below should be replaced to show all 6 tests.

Unit Testing

This screen shot needs replacing by the students own unit testing

Valid Black Box

Test No Proposed Test Data Entered Expected Result Actual Result Comments
01 Miles to Feet miles = 2.0 10560
02 Feet to Miles feet = 10560 2.0
03 Miles to Metres metres = 2.0 3218.69
04 Metres to Miles metres = 3218.69 2.0
05 Metres to Feet metres = 2.0 6.56168
06 Feet to Metres feet = 6.56168 2.0

Invalid Black Box

Test No Proposed Test Data Entered Expected Result Actual Result Comments
01 Invalid distance miles = 1.0m Error Message & repeat
02 Invalid distance miles = -50 Error Message & repeat
03 Invalid unit choice choice = 55 Error Message & & repeat

Evaluation

The student should add five limitations or useful extensions that could be added to the application

  1. Improvement, Extension or limitation
  2. Improvement, Extension or limitation
  3. Improvement, Extension or limitation
  4. Improvement, Extension or limitation
  5. Improvement, Extension or limitation