Вы находитесь на странице: 1из 4

Module PR211 Programming (PP C++) Assignment PP5 Weighting 10%

Credits 14

Learning Hours 140 Tutor: Dr Jan Pajak

Total marks 10 - Merit 9.5, Pass 8 Due Date Resits Friday, 6 September 2002, 4 pm. If a resit is required, it is the students responsibility to organise a due date for this. This must be done within one week of results being posted. This resit time must be negotiated with the tutor.

Supplied Information A. Assignment topic. Write, document, test, and enhance a C++ program which meets the specification given below B. Program specification. #6A. Write a C++ program named BubbleSort.cpp, which is to sort names alphabetically in the ascending order. This program is to repeat the following activities, until the user does not wish to continue the processing any further: 1. Greets the user and explains the program purpose. 2. Displays a Menu with following compulsory options: 1.Input data items from the keyboard 2.Display data items 3.Sort data items in the ascending order 4.Exit Optionally (for merit only): the menu has also two additional options, namely: - Input data items from a disk file - Output data items to a disk file. 3. If the user chooses the option 1. Input data items from the keyboard, your program asks how many names you wish to input as data items, and then inputs all these data items and stores them in an array. 4. If the user chooses the option 2. Display data items, the program should display all names that are stored in an array. 5. If the user chooses the option 3. Sort data items in the ascending order, the program should sort all names from that array into the ascending order. 6. If the user chooses the option 4. Exit, the program terminates the processing. (Optional for merit only) 7. For merit, independently from the menu options for the keyboard input and screen output, your program should also include options that allow to input names from a disk file named names.dat, and to output the outcomes of processing into a different disk file named names.txt (if the user to run any of these additional menu options). Test your program with at lest 10 names, out of which 4 names have the first 3 letters identical. C. To be handed in. The final package that you are to handle in should include: 1.A standard cover page (filled up), as requested for all IT assignments
This Controlled Document was issued for PR211, by Dr Jan Pajak On 12 April 2013 at 12:25 Document Revision #: 1 Assignment PP5 page 1 of 4

2.A printout of the C++ source code for the BubbleSort.cpp program (prepared via Borland C++ Builders editor). Note that this source code must have appropriate internal documentation, meaningful names, indentations, etc, as requested in the marking schedule. 3.Screen image(s) of results from your program, captured for 10 test names input at random, and for the same names sorted in ascending (alphabetic) order. 4.Diskette with a source code (BubbleSort.cpp) and with executable version (BubbleSort.exe) of your assignment. (Optionally for merit, with input and output files: names.dat and names.txt) This diskette should be attached in some kind of a permanent pocked stapled or sellotaped semi-permanently to your assignment package (so that disk would not be able to detach on its own). 5.Filed up copy of the marking schedule attached to this assignment topic. D. Program demonstration. In case of doubts regarding the mark, after the assignment is marked you may be asked to demonstrate the operation of your program, including the demonstration of data values on which you tested it.

This Controlled Document was issued for PR211, by Dr Jan Pajak On 12 April 2013 at 12:25

Document Revision #: 1 Assignment PP5 page 2 of 4

E. Program marking. This assignment is self-assessed, although your mark is the subject of confirmation by the tutor. The objective is to give you the best possible idea about the criteria that a good C++ program fulfils, thus to allow you to gradually improve on your results. In order to self assess your assignment, you need to detach this page, fill up the marks field () for each assessment criteria that is listed below. Note that each one of these criteria is worded in such a manner, that in connection with our theory classes, it should give you a good idea as to what quality level is expected from you for this criterion. Should you not completely meet a given criterion, then allocate a mark to your assignment, which in your opinion your assignment deserves (use on accuracy of marking equal to 0.1). After you fill up this form, sign enclose it, enclose it with your assignment documentation, and hand it in to the box of IT assignments. Thank you. #1. Internal documentation (allocated 2.5 marks in total). Give these marks (or appropriate fraction of them) to your assignment, if the internal documentation from your program: (0.5 mark) Includes a header, which answers questions what, who, when, where: (0.5 mark) All variables in the code of your program have satisfactory descriptions : (0.5 mark) All functions, tricky parts of code, and assumptions taken are documented: (0.5 mark) Your program displays the presence of proper indentations, the length of all lines on the printout does not exceed the page width. . (0.5 mark) All user-given names are meaningful and consistently written with the use of either conventional_notation or StadleyCaps. . Your assessment of your accomplishment for this criterion #1 is:(marks) #2. Menu and user-interface part of the application (allocated 2.5 marks). Award marks if the application: (a) Greets the user and explains what is for (what is the purpose of it), (b) all displays that your application produces are informative and clearly inform the user what is expected to be done and in what order this should be done, (c) your application provides format of data to be input (and/or example of data) in each case it asks for some input, (d) each input data is validated, and if typed wrongly an error message is displayed, (e) the screen with results waits until the user finishes reading it. Your assessment of your accomplishment for this criterion #2 is:(marks) #3. Algorithm accuracy (allocated 2.5 marks). Award yourself marks for this point only if your program works properly and produces correct results for all test data marked as for pass. If this initial condition is met than give yourself the appropriate proportion of the mark allocated to this criterion, which depends on how well your application fulfils the following conditions: (a) your manu chooses correctly all options listed for this assignment (for pass), and carries out calculations assigned to these options, (b) For every one of these required options, your application correctly reads data and calculates error free results for any data that belong to the for pass category. Your assessment of your accomplishment for this criterion #3 is:(marks) #4. Premium marks for solving the tricky part of the program (allocated 1.5 marks). Give these marks to yourself only when your program is able to correctly input data from (and output to) both: the keyboard, and a disk file depending on the user choices of menu options. Your assessment of your accomplishment for this criterion #4 is:(marks) #5. Marks for the entire assignment package (allocated 1 mark). Give this mark to your assignment only when:
This Controlled Document was issued for PR211, by Dr Jan Pajak On 12 April 2013 at 12:25 Document Revision #: 1 Assignment PP5 page 3 of 4

(0.5 mark) Your assignment package contains all items listed in: C. To be handed in, and each of these item meets professional criteria outlined for it. (0.5 mark) A diskette with your program contains both versions of your program (i.e. source *.cpp, and executable *.exe), and when the executable version after being executed directly from the diskette with the use of Windows Explorer, works the same correctly as the source version. Your assessment of your accomplishment for this criterion #5 is:(marks) Total marks from all four criteria (add #1, #2, #3, #4, and #5) is:....(marks). #6. In case of late assignments. Subtract 1 mark if your program is handed on Monday (after the coming weekend), and further 0.5 marks for each next day of delay. If, after this subtraction, your mark drops below 8, but the total mark for all 4 criteria above is above 8, your assignment is going to automatically be counted as resit. (Means that you loose a chance for merit). #7. Grade. If the final mark (even after subtraction for late assignments) is between 8 and 9.4, your grade is P (pass). If your final mark is 9.5 or above, your grade is M (merit). Write your grade here: (grade) Signature of the student marking: ...; Date:

This Controlled Document was issued for PR211, by Dr Jan Pajak On 12 April 2013 at 12:25

Document Revision #: 1 Assignment PP5 page 4 of 4

Вам также может понравиться