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:-
- Output a heading with the name of the application and the name of the programmer.
- Input any valid distance measured in miles
- Convert that distance into feet
- 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:-
- Output a heading with the name of the application and the name of the programmer.
- Input miles and convert it to feet.
- Input feet and convert it to miles
- 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:
- Output a heading with the name of the application and the name of the programmer.
- Prompt the user to select which unit to convert from (Miles, Feet or Metres)
- Prompt the user to select which unit to convert to (Miles, feet or Metres)
- Convert the from distance entered into the to distance using the selected units.
- Output the distance in the to distance units.
Design: UML Activity Diagram
Stage 1
Stage 3
Design: UML Class Diagram (10 Marks)
The student should add a Class diagram of the completed App01 here
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)
Unit Testing (24 Marks)
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
- An improvement would be to have an error message when entering an invalid data without having the program crash
- 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.
- Another improvement is to have a interactive interface that is with html to make it better to look at when opening the program
- 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