A program is required to receive this data for each mine from the keyboard.

 

  1. the number (integer) allocated to the mine

  2. the year the mine opened

  3. the year the mine closed

  4. the total ore production

 

(eg. 9 1811 1880 17430 )

 

 

It should then output

 

  1. the lifespan of each mine

  2. the average yearly ore production of each mine

  3. the total ore production of all the mines

  4. the number of the mine with the longest lifespan

 

You can assume that

 

  1. All mine lifespans are different

  2. All data will be entered correctly

 

 

Test plan

 

Devise a series of test runs to thoroughly test the program. For each test run

  1. Write down the test data explain what aspects of the program it will test,

  2. Write down the expected results. Justify the results showing calculations and results.

 

 

 

Program Design

 

  1. Using stepwise refinement produce an algorithm for the program, written in pseudo-code.

  2. Produce a data table of identifiers

 

Coding

 

From your pseudo-code, write the program in C. make sure the program is clearly laid out and includes appropriate comments and indentations.

 

Testing

 

Using your test plan, run and debug the program. Produce evidence of testing.

 

Hand in

 

You should submit your design documents, test plan and evidence of testing. You should also submit an electronic version of your program, naming this program mine.cpp.

 

Both Sprint 2 and Sprint 3 will work independently of each other. Note that Sprint 3 is expected to work with the program written for Sprint 1 – but not with the version covered in Sprint 2.

 

Sprint 2 (20% of the marks)

Specification

 

After further consultation the historian has discovered that some mines had the same lifespan and there could be two or more mines with the highest lifespan.

 

Using your first sprint change the code to save the lifespans of each mine in an array, as they are calculated. The highest lifespan should be found, as before, but the numbers of the mines with the highest lifespan/s should be found and output after all the data has been entered.

 

(hint: as the lifespan is calculated hold in an array)

 

For this program you can assume that all data will be entered correctly.

 

Test plan

 

Can you use the same test data for this program? If so, explain how this is possible. If not, make up further test data.

 

Coding

 

Write the code required, developing the program from Sprint 1 (but making sure you keep a copy of that working program).

 

Testing

 

Using your test plan, run and debug the program. Produce evidence of testing.

 

Hand in

 

 

You should submit your test plan and evidence of testing. You should also submit an electronic version of your program naming this program mine2A.cpp.

    • 10 years ago
    Assignment Completed
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      sprint1.doc
    • attachment
      sprint2.doc