联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codehelp

您当前位置:首页 >> Matlab程序Matlab程序

日期:2020-10-09 08:12

KIT107 Programming 2020
Assignment 3
Due Date
The assignment is due at 3PM Friday October 16th 2020 and should be completed with a
partner. You and your partner should work together on all of the design and
programming. It should be done using the pair-programming methodology and not by
division of labour. Use the “Assignment 3 Pairs” groups on MyLO to find and register
your pair.
Context
The assignment is to construct a program that given some representation of a maze will
find the path through to the end without you lifting a pencil or getting mud on your
shoes!
An example of a maze is the following:
Start
1 2 3 4 5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21
Stop!
22 23 24 25
26 27 28 29
30 31 32 33 34
35 36 37 38 39 40
41 42 43 44 45 46 47 48 49
The challenge is to find a path from the square marked Start to the square marked
Stop! by moving forwards, turning left, and turning right (with all directions relative to
the current direction of travel) without going through “walls” which are indicated as
black squares.
The application of this game to computing is the design of a program that allows a
starting square to be given and then for the user to be graphically shown a solution
derived by the computer. The computer will select moves by creating a game tree. A
game tree consists of all the possible states of the game and in this assignment the
computer determines any possible solution as the best one. Each node of the game tree
has children that indicate the states of the game that follow from the state of the parent
2/6
for each possible move, i.e. each node in the tree possesses three branches which
represent the maximum possible moves from the parent node.
This assignment uses many data structures (trees, linked-lists, stacks, and queues) to
solve the puzzle. The game will be text only.
A sample run of the game is shown below for depth-first:
And breadth-first:
3/6
Task
A Visual Studio project file is available for download from MyLO. The project
contains many header (.h) and source (.c) files. All required files are present.
Your task is to complete the functions within the program files which have been
declared but for which the function bodies are missing and to update the header
comments for the source files that you change.
Program Style
Your program should follow the following coding conventions:
? const variable identifiers should be used as much as possible, should be
written all in upper case and should be declared before all other variables;
? Variable identifiers should start with a lower case letter, be meaningful, and
variables should only be declared at the top of a function;
? Every if and if-else statement should have a block of code (i.e. collections
of lines surrounded by { and }) for both the if part and the else part (if used);
? Every loop should have a block of code;
? The keyword continue should not be used;
? The keyword break should only be used as part of a switch statement;
4/6
? Opening and closing braces of a block should be aligned;
? All code within a block should be aligned and indented 1 tab stop (or 4 spaces)
from the braces marking this block;
? Commenting:
o There should be a block of header comment which includes at least
? file name
? student names
? student identity numbers
? a statement of the purpose of the program
? date
? the percentage of the work completed by the authors — 50:50 is
expected and assumed but reasons should be given if it is
more/less than this
o Each variable declaration should be commented
o There should be a comment identifying groups of statements that do
various parts of the task
o Comments should describe the strategy of the code and should not
simply translate the C into English
Style marks will be awarded proportionally, i.e. if you attempt only half the coding you
can expect only half the style marks.
Marking scheme
Task/Topic Maximum
mark
Program operates as specified
square_state.c correctly completed 2
game_state.c correctly completed 10
t_node.c correctly completed 5
game_tree.c correctly completed 21
stack.c correctly completed 5
queue.c correctly completed 5
Program Style
Does not unnecessarily repeat tests or have other redundant/confusing code 6
Uses correctly the C naming conventions 6
Alignment of code and use of white space makes code readable 6
Always uses blocks in branch and loop constructs 6
Meaningful identifiers 6
Variables declared at the top of functions 6
Each variable declaration is commented 6
Comments within the code indicate the purpose of sections of code (but DO NOT just
duplicate what the code says)
6
What and how to submit
You should ZIP up your project folder and submit it. Do not submit a RAR file.
What to submit
? You should submit the entire Visual Studio project folder compressed as a ZIP
file.
5/6
How to submit
? Log in to MyLO and navigate to the Assignments tool under the
Assessments icon in the top tool bar.
? Select Assignment 3 from the list of available drop-boxes.
? Click on Add a File and follow the instructions to attach your ZIPped
project folder and then click Add. Then click Submit.
If you want to resubmit, rename your ZIPped project folder as ‘version 2’ and repeat the
submission process.
Remember that only one paper and electronic submission is required per pair; you must
be registered in an “Assignment 3 Pairs” group on MyLO in order to make a
submission.
Plagiarism and Cheating:
Practical assignments are used by Discipline of ICT for students to both reinforce and
demonstrate their understanding of material which has been presented in class. They
have a role both for assessment and for learning. It is a requirement that work you hand
in for assessment is substantially your own.
Working with others
One effective way to grasp principles and concepts is to discuss the issues with your
peers and/or friends. You are encouraged to do this. We also encourage you to discuss
aspects of practical assignments with others. However, once you have clarified the
principles, your pair must express them in writing or electronically entirely by
yourselves in your pair. In other words you must develop the algorithm to solve the
problem and write the program which implements this algorithm with your partner and
no one else (other than staff).
Cheating
? Cheating occurs if you claim work as your own when it is substantially the work
of someone else.
? Cheating is an offence under the Ordinance of Student Academic
Integrity within the University. Furthermore, the ICT profession has ethical
standards in which cheating has no place.
? Cheating involves two or more parties.
o If you allow written work, computer listings, or electronic version of
your code to be borrowed or copied by another student you are an equal
partner in the act of cheating.
o You should be careful to ensure that your work is not left in a situation
where it may be stolen by others.
? Where there is a reasonable cause to believe that a case of cheating has occurred,
this will be brought to the attention of the unit lecturer. If the lecturer considers
that there is evidence of cheating, then no marks will be given to any of the
students involved. The case will be referred to the Head of School for
consideration of further action.
Julian Dermoudy, September 23rd 2020.

版权所有:留学生编程辅导网 2021,All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。