App 01 - AtishAppadu/C-console-apps- 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.

Features Stage 1

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 The input and output should accept numbers that include the decimal point, and this app can use the fact that 1.0 miles is exactly 5280 feet.

Features Stage 2

The application should:-

  1. Output a heading with the name of the application and the name of the programmer.
  2. Input miles and convert it to feet.
  3. Input feet and convert it to miles
  4. Input miles and convert it to metres This app can use the fact that 1.0 miles contains 1609.34 metres

Features Stage 3

The Application should:

  1. Output a heading with the name of the application and the name of the programmer.
  2. Prompt the user to select which unit to convert from (Miles, Feet or Metres)
  3. Prompt the user to select which unit to convert to (Miles, feet or Metres)
  4. Convert the from distance entered into the to distance using the selected units.
  5. Output the distance in the to distance units.

Design: UML Activity Diagram

Stage 1

Activity Diagram

Stage 3

Activity Diagram

Design: UML Class Diagram (10 Marks)

The student should add a Class diagram of the completed App01 here App01 Class Diagram

This was completed in Visual Studio which cannot display the relationships and therefore gets less marks (2) than the same diagram completed in Visual Paradigm.

Testing: Screen Shots (16 Marks)

Screen Shot

Unit Testing (24 Marks)

Unit Testing

This screen shot needs replacing by the students own unit testing

Testing: Black Box (30 Marks)

Valid Data

Test No Proposed Test Data Entered Expected Result Actual Result Comments
01 Miles to Feet miles = 1.0 5280 5280 ok
02 Miles to Feet miles = 2.0 10560 10560 feet ok
03 Feet to Miles feet = 5280 1.0 1 miles ok
04 Feet to Miles feet = 10560 2.0 2 miles ok
05 Miles to Metres miles = 1.0 1609.34 1609.34 metres ok
06 Miles to Metres miles = 2.0 3218.69 3218.69 ok
07 Metres to Miles metres = 1609.34 1.0 1 miles ok
08 Miles to Metres metres = 3218.69 2.0 2 miles ok
09 Metres to Feet metres = 1.0 3.28084 3.28084 feet ok
10 Metres to Feet metres = 2.0 6.56168 6.56168 feet ok
11 Feet to Metres feet = 3.28084 1.0 1 metres ok
12 Feet to Metres feet = 6.56168 2.0 2 metres ok

Invalid Data

Test No Proposed Test Data Entered Expected Result Actual Result Comments
01 Invalid distance miles = 1.0m Error Message Error Program crashes when an invalid input has been entered
02 Invalid unit choice = 55 Error Message Error Program crashes when an invalid input has been entered
03 Invalid number choice = "miles" Error Message Error Program crashes when an invalid input has been entered

Evaluation (20 Marks)

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

  1. An improvement would be to have an error message when entering an invalid data without having the program crash
  2. An extension would be to have another app such as app 2 to be in the same environment so that distance converter can be an option as BMI calculator can also be an option.
  3. Another improvement is to have a interactive interface that is with html to make it better to look at when opening the program
  4. Improvement would be to have an exit message when closing the program such as "would you like to exit the distance converter?" to make it more user friendly