Assignment title: Information


ICT159 Introduction to Computer Science Assignment 2 DUE : See LMS General Submission Guidelines – Please Read Carefully! FAILURE TO ADHERE TO THESE GUIDELINES WILL RESULT IN MARKS BEING DEDUCTED OR A FAIL GRADE BEING AWARDED. • Your assignment MUST be submitted TWO separate ways: • A physical printed copy containing ALL sections plus CD-ROM etc. with electronic versions of required sections (as detailed below). • A duplicate electronic copy of your entire assignment submitted via LMS containing ALL sections. Please note that it is necessary to submit your assignment BOTH ways. If you only submit an electronic copy via LMS then your assignment will NOT BE ACCEPTED. The purpose of the electronic submission is to act as additional proof of assignment submission and is not acceptable as a substitute for appropriate hardcopy submission in this unit. • All assignments must be word processed and proof read: no hand written work will be accepted. • Students are strongly advised to use the assignment template provided in this document. Using a different or altered structure provided may result in marks being deducted due to assignment requirements not being met. • Complete and include the assignment cover sheet with your submission. • All questions and sections within questions must be submitted in order: marks may be deducted otherwise. • Included with your submission should be the documentation for the assignment as a printout (including source code of your solution) and a CD-ROM containing the source and a compiled program of your solution. Further details for this are given below. • The assignment requires the submission of eight different sections as specified below. Your final submission should be prepared as a single document containing each of the sections in order. You can do this by copying and pasting your algorithms/code into this document. Code and algorithms within this document should be formatted with a font such as Courier New to enhance their readability and you must also include your code as separate files on CD-ROM etc. ready for compilation. • You must check your CD-ROM for viruses. Any CD-ROM with malicious code on it will result in that student receiving an automatic fail for this assignment. • The CD-ROM should only contain work related to your assignment and all work should be in the root directory of the disc, not in separate subdirectories: material in subdirectories may not be marked! • Submitting USB flash drives is also acceptable, however, no responsibility will be taken if your flash drive is lost after being submitted. • Write your name, student number and assignment details on the CD label etc. • Electronic only submission (i.e. without the hardcopy printout) will not be accepted in this unit. This requirement applies to both internal and external students. • Internal students must submit completed assignments via the assignment boxes adjacent to School of Engineering/IT Office SC 2.026. • External students please send your printed assignment and CD-ROM by post your tutor, c/o School of Engineering and Information Technology, Murdoch University, South Street, Murdoch, 6150) as printouts and electronic submissions on CD-ROM/USB. E-mail submission of assignments is not acceptable in this unit. • Remember all external students must submit the labs as specified in the unit guide along with their completed assignment: these must include printouts of the algorithms and source code, plus an electronic copy of your source code. • Assignments must be received by the deadline. Late assignments will be penalised 10% per day late. Please note this is a flat 10% deduction and not 10% of your unpenalised grade. • Should you anticipate difficulty in completing this work by the specified deadline, you should contact the Unit Coordinator via e-mail as soon as possible to discuss whether an extension may be granted. Note that extensions will not normally be granted very close to the due date or without suitable grounds. Also, except in exceptional circumstances, the amount of extra time that can be granted will normally be quite limited. If you have been granted an extension, you must include a printed copy of the e-mail confirming this with your assignment submission. You should keep a copy of all your work. This assignment is worth 20% of the total assessment for the unit. Assignment Sections – These Must All be Included in Your Submission Your assignment must contain the following sections as a printout (except where indicated): 1. All assumptions made other than those stated in the question that you make about the problem. There will virtually always be assumptions you are implicitly making so think about this very carefully! (5%) 2. Your algorithm written in a uniform fashion using a pseudocode or a similar style and adhering to the conventions required in the unit. Your algorithm should be presented at an appropriate level of detail sufficient to be easily implemented. Submit your high level algorithm (where necessary) along with algorithms of your decompositions as appropriate to the question. (20%) 3. A set of test data with expected results and desk check results from your algorithm. (20%) 4. A hard copy (i.e., on paper!) of your source code. Make sure you use the code style required in the unit. (20%) 5. A soft copy (on CD) of your source code in the root folder. (5%) 6. A soft copy of your compiled program in the root folder which operates correctly. (20%) 7. Results of applying your test data to your final program, including a sample printout of your program in operation if appropriate. (5%) 8. Self-assessment of how successful you were in achieving the requirements and a discussion of any problems you encountered. (5%) Please submit the printed sections in order. Marks may be deducted otherwise. Each question is worth equal marks. And each part must have a separate program and separate set of documentation submitted. Each question is worth equal marks. And each part must have a separate program and separate set of documentation submitted. Question 1 You should read this question as if the change giver is a bank teller who has to give amounts of money to customers but can't count very well so needs you program to help them. You are asked to write a simple C program that will accept an integer value in the range of 5-95 and as a multiple of 5 representing the number of cents to give to a customer in their change. The program should calculate how many coins of each denomination and display this to the user. Valid coin values are 50, 20, 10 and 5. Your solution (program and algorithm) should be modular in nature. This requires the submission of a high-level algorithm and suitable decompositions of each step. Note that for this problem the principle of code reuse is particularly important and a significant number of marks are allocated to this. You should attempt to design your solution such that it consists of a relatively small number of functions that are as general in design as possible and you should have one function in particular that can be reused (called repeatedly) in order to solve the majority of the problem. If you find that you have developed a large number of functions which each perform a similar task (or have a lot of repeated code) then attempt to analyse your design to generalise the logic so that it may be reused. Question 2 You are to extend your solution to Question 1 above by allowing the user to enter the amount of change as dollars and cents as a double (real number). Valid dollar values are 100, 50, 20, 10, 5, 2 and 1. You program should output the correct combination of dollar and cent denominations required and should be able to work for any valid dollar amounts. Cents amounts may be should be multiples of 5 as in the previous question. In this question you will need to explicitly convert a double to an integer to break the inputted double down to its component parts as integers. You can use the following code as the basis for doing this: float change; int dollar, cents; ... dollar = (int) change; cents = (int) (((change – dollar)*100) + 0.5); Again your solution for this problem should be modular. When submitting assignment, delete this and all previous pages. School of Engineering and Information Technology ICT159 ASSIGNMENT COVER SHEET Name: _____________________________________________________________________ Surname given names student number Name of tutor: _____________________Day & Time of tutorial: ________________ Assignment Number: __2__ Due Date: ____________Date Submitted: _______________ If the given name by which your tutor knows you differs from your name on university records, you should indicate both names above. Your assignment should meet the following requirements. Please confirm this (by ticking boxes) before submitting your assignment. Note that if all these requirements are not met then marks may be deducted or your assignment not accepted at all at the unit coordinator's discretion.  Assignment is presented on A4 size paper and is neatly collated.  Assignment contained within A4 plastic envelope or folder  Assignment includes CD with machine readable programs & files relevant only to this submission  Writing is clearly legible or has been printed.  Pages have been firmly stapled.  The parts of each question have been submitted in the correct order.  A copy has been retained by me.  Declaration below is completed.  Electronic version of assignment also submitted via LMS All forms of plagiarism, cheating and unauthorised collusion are regarded seriously by the University and could result in penalties including failure in the unit and possible exclusion from the University. If you are in doubt, please contact the Unit Coordinator. Declaration Except where I have indicated, the work I am submitting in this assignment is my own work and has not been submitted for assessment in another unit. Signature_______________________________________ OFFICE USE ONLY Date received Marked by Date marked Marks/Grades Question 1 1. Assumptions • First assumption • Second assumption • … 2. Algorithm 3. Test Table 4. Code 7. Results of Program Testing 8. Self Assessment Question 2 1. Assumptions • First assumption • Second assumption • … 2. Algorithm 3. Test Table 4. Code 7. Results of Program Testing 8. Self Assessment