首页 > > 详细

C辅导 EEE101 : ASSESSMENT 4辅导R、R程序讲解

Introduction
C,,,,,
4,,。
,。
Requirement
image from: www.amazon.com
EEE101 C Programming and Software Engineering 1 – ASSESSMENT 4
Assessment Number 4
Contribution to Overall Marks 25%
Issue Date 14/11/2016
Submission Deadline 28/11/2016 at 0900 (9am)
Assessment Overview
This assessment aims at testing some concepts of C programming in particular the use of
two-dimensional arrays, and the use of pointers to pass them between functions, as well as
the routine of code development using the software development process (SDP) presented in
Lecture 1, namely the five main steps of the software development process:
1. Problem statement: formulate the problem.
2. Analysis: determine the inputs, outputs, variables, etc
3. Design: define the list of steps (the algorithm) needed to solve the problem.
4. Implementation: the C code has to be submitted as a separate file. Just indicate here the
name of the file.
5. Testing: explain how you have tested and verified your C program.
EXERCISE 1 (10 POINTS OUT OF 10)
Connect 4 is a game of strategy for 2 players. Each player chooses a counter colour and then
they take turns to place the counters into a rectangular grid of size M x N (typically 6 x 7).
Counters are placed into the top of a column and fall down to occupy the next available slot
in that column (see the photo in Figure 1). The game is won when either player is able to
create a line of 4 counters vertically, horizontally or diagonally.
Figure 1: Connect 4 Game
This assignment requires you to use a 2 dimensional matrix together with a modular
programming strategy to recreate this game using C programming. Your game will allow you
to play either against another person, or against the computer who will place counters at
random.
Program Requirements
 Offer the user a choice between playing the computer or another player.
 Display the current state of the board to each player
 You should use one or more 2 dimensional matrices to represent the Connect 4 playing
board declared inside function main() as a local variable and passed to other functions as
needed.
 As a minimum you should create your own functions to perform. the following tasks:
1. input counters;
2. check the board for a win;
3. display the board;
Programming Constraints
All variables used must be local.
Ideas
Try to keep your program as flexible as possible e.g. use constants to define matrix sizes so
that these could be easily changed.
Program in small sections, getting each part to work before integrating them all.
Consider how to deal with invalid inputs to avoid crashing the program.
Consider providing an option to change the matrix size and the winning length (e.g. connect 5)
Don’t forget that this is an interactive game, it should be easy to use and look tidy
Note: The programme requirements are becoming more vague (less well defined) with each
assignment to allow you the opportunity to interpret the problem in your own way and
develop your own solution.
What should be submitted?
You should submit the followings:
1) A short report (up to a few pages of text plus C source codes) detailing for each question:
a) SDP steps 1 to 3 in the report (Report + Specification + Analysis + Algorithm Design)
(40%)
b) SDP step 4 (Implementation(35%) + Robustness(10%)): your C source code including
the comments. (45%)
c) SDP step 5 in the report (testing): you will explain your testing methodology
including: what you wanted to test, how you have tested it and the outcome of your
tests. (15%). Note: you do not need to include screenshots of results
Please refer to the file “EEE101 Marking Guidelines Assignments 4-5” on ICE
for a detailed marking scheme.
2) The report in Microsoft Word or pdf format and C source code of your implementation
for each question should be zipped into a single file, i.e. the zip file will contain 4 files,
two reports and two source codes. (It is a good practice to include comments in your
code stating the aim of the program, what are the inputs, what are the outputs, which
algorithm is used, who is the author and so on.)
The naming of Report ( .doc or .pdf), Source Code (.c) and Compressed file (.zip, or .rar)
 StudentID_LastName_FirstNameAssignmentNumber-QuestionNumber.docx or .pdf
 StudentID AssignmentNumber-QuestionNumber.c
 StudentID_LastName_FirstName_AssignmentNumber.zip or .rar
For example
 10115085_Zhang_Hanqing_4-1.docx
 10115085_4-1.c
Zipped together into:
 10115085_Zhang_Hanqing_4.zip
How the work should be submitted?
Should be submitted electronically through ICE so that the marker can run your programs
during marking. Feedback and your grade will also be given through ICE.
Remember that you are responsible for ensuring that your C code will run in Visual Studio
2013 and that if it does not without documentary explanation you may get a 0 mark for your
implementation.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!