Software Design Specification

MPG Tracker Programming Quiz 12/13/13

Name: Date:

Computer Science: AM PM

(You may fill-in-the-blanks and use this page as notes and documentation)

(Put your name and date copyright notice as comments at the top of the VB.NET program)

1.  Summary: Project Name – MPG-Tracker

a.  Design and program a VB.NET Project to calculate and display Miles per Gallon

b.  MPG - Miles Per Gallon - wikipedia.org - The fuel efficiency relationship between the distance traveled and the amount of fuel consumed by the vehicle

c.  Save the project to your “Z:\vbNet_css##\” folder named MPG-Tracker

2.  Definitions:

a.  Miles Travelled – the distance a car travels between gasoline fill-ups

b.  Gallons Used – the number of gallons of gas used between fill-ups

c.  MPG – miles per gallon, a mathematical formula expressed as:

mpg = (miles travelled) / (gallons used)

3.  Requirements:

a.  The user will enter miles traveled and gallons used: How?

b.  The user will click a button to calculate mpg: How?

c.  The computer will display mpg achieved: How?

d.  The computer will display today’s date, such as “mm/dd/yyyy”: How?

4.  Extras:

a.  Format any real numbers to 2 decimal places, such as “12.34”: How?

b.  Use a text file to keep track of past entries: How?

c.  Read text file and display past entries: How?

d.  Update today’s entry into the text file: How?

5.  How each requirement will be achieved:

a.  Correctly calculate mpg = 80 points (C)

b.  Correctly real numbers to 2 decimal places = additional 10 points (B)

c.  Correctly track entries in a text file = additional 10 points (A)

6.  Assumptions:

a.  The computer date will be correct

b.  The user will probably make a mistake in entering miles traveled or gallons used

c.  The program MUST catch any user errors and display a helpful warning message

d.  The text file may mistakenly be erased

7.  Constraints:

a.  Display useful (and clean) messages when the user makes a mistake: How?

8.  Software risk analysis: None

9.  Development procedures and coding guidelines:

a.  Use textbox control objects for input: How?

b.  Use command button control objects for user-generated events: How?

10.  Standard languages and tools:

a.  VB.NET 2010 or 2008

b.  Wintel (Windows/Intel) based personal computer

11.  Definitions of variables and a description of where they are used:

a.  Variable to hold miles traveled

b.  Variable to hold gallons used

c.  Variable to hold mpg

d.  Variable to hold today’s date

e.  Any other variables

12.  Logical structure and logical processing steps:

a.  User-generated Exit: How?

b.  User-generated Calculate MPG: How?

c.  User-generated Add to Text File: How?

13.  Error, alarm and warning messages: As needed

14.  Security measures: As needed

15.  Performance: Sample Input:

a.  300 miles / 10 gallons = 30.00 mpg

b.  250 miles / 8 gallons = 31.25 mpg

c.  400 miles / 13 gallons = 30.77 mpg

d.  Blank miles / any gallons = error message

e.  Any miles / blank gallons = error message

16.  Reliability:

a.  Try any expected exceptions: How?

b.  Catch any errors and display a useful error message: How?

17.  Questions and Answers:

a. 

b. 

c. 

d. 

e.