Foundations of Programming
Assignment 1
OBJECTIVES:
Construct algorithms to solve problems using a combination of sequence, selection and iteration constructs.
Implement such algorithms in a common programming language, C.
Apply the methodology of top-down design to the construction of solutions and implement these solutions in a modular way.
This assignment also serves as preparation for Assignment 2 and so this assignment must be completed.
Assignment Sections:
Your assignment must contain the following components either in the documentation or as separate electronic files (.c and .exe), where indicated:
All assumptions made about the problem and your solution (eg: data types, currency, language, etc.). There will virtually always be assumptions that you are implicitly making so think about this carefully. However, your assumptions cannot contradict the question requirements. Also be careful that you do not put in unnecessary assumptions (eg: things that are stated in the question). (3%)
Structure chart for your solution. This demonstrates the design of your solution. The structure chart must show data flow (i.e. parameter passing and return values). (10%)
Your algorithm written in a uniform fashion using a pseudo-code and adhering to the conventions required in the unit. Your algorithm also demonstrates the design of your solution and must be consistent with your structure chart. The algorithm should be presented at an appropriate level of detail sufficient to be easily implemented. Submit your high-level algorithm and the low-level decompositions of your solution, as appropriate to the question. Algorithms that look like the code was written first and then word processed to look like an algorithm would receive no marks. (15%)
A set of test data in tabular form with expected results and desk check results from testing your algorithm. Each test data must be justified – reason for selecting that data. No marks will be awarded unless justification for each test data is provided. (15%)
Source code file (.c) and program executable (.exe) must be submitted (separate to your documentation). The source code must be consistent with your algorithm (both high- and low-levels). The source code must build (compile and link) to create an executable that operates correctly. Make sure you use the code style required in the unit. No marks awarded if the source code does not build and run. (40%)
Results obtained by applying your test data to your final program. That is, you must provide sample printouts of your program in operation (i.e. actual program output from applying the test values nominated in the test table in point 4 above). (10%)
Self-assessment of how successful you were in achieving the requirements and a discussion of any problems you encountered. (7%)
The self-assessment must be submitted in two parts:
A self-assessment write up done here in the document template.
You need to also submit a separate file named txt. This file will have, in point form, a summary of what works and what does not work in your program. A false claim here would mean that marks for this component would not be awarded. So make sure that you have tested your program thoroughly. The file evaluation.txt will also declare if you have checked each submitted file for viruses or malware. Name the tool and version number of the tool that you used to conduct the check.
Assignment Question:
You should read this question as if the change giver is an artificial intelligence-based bank teller who has to give amounts of money to customers by automatically working out the amounts.
You are asked to write a modular solution (algorithm and C program) that will accept an integer value in the range of 5-95 inclusive. Your solution should also ensure that input values are in multiples of 5. Based on valid input, your solution should calculate how many coins of each denomination should be returned, and display this to the user. Coin values are 50, 20, 10 and 5. The solution should aim to give as much of the higher valued coins as possible. For example, a poor solution for an input of 30 cents would give six 5 cent coins. A correct solution would give a 20 cent coin and a 10 cent coin. After each output, the user should be asked whether they wish to continue or exit/terminate the program. Your solution (algorithm and program) should be designed using a modular approach. This requires the submission of a structure chart, a high-level algorithm, and subsequent decompositions of each step (i.e. low-level algorithms).
Note that for this problem, the principles of code reuse and high cohesion are particularly important and a significant number of marks are allocated to these aspects of your design.
You should attempt to design your solution such that it consists of a relatively small number of modules, but still meets the modular design best practice requirements of this unit. In particular, strive to have one module that can be reused (called repeatedly) to solve the coin calculation problem. If you find that you have developed a large number of modules where each performs a similar task, or that you have a lot of instructions that are repeated in one module, then attempt to analyse your design to generalise the logic so that you have just one general version of the module.
Assignment 1
Assumptions
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. However, your assumptions cannot contradict the assignment question. Also be careful that you do not put in unnecessary assumptions. (3%)
First assumption
Second assumption
Structure Chart
Structure chart for your program. Show parameter passing. (10%)
Algorithm
Your algorithm written in a uniform fashion using a pseudo-code 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.
Algorithms that look like the code was written first and then word processed to look like an algorithm would receive no marks. (15%)
Test Table
A set of test data in tabular form with expected results and desk check results from your algorithm. Each test data must be justified – reason for selecting that data. No marks will be awarded unless justification for each test data is provided. (15%)
Add rows to the following table as needed. Table can span more than one page. Each test id tests only one condition for the desk check. There should be no duplicated reasons listed in the second column.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of