辅导案例-CSCU9V4-Assignment 2

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
Division of Computing Science and Mathematics



CSCU9V4: Systems

Assignment 2 (revised) - Spring 2020
Algorithm development in C

Student ID:

Task Marking Scheme Marks distribution
1. Task 1 ................................................................................................................................ /15
2. Task 2 ................................................................................................................................ /15
3. Task 3 ................................................................................................................................ /15
4. Task 4 ................................................................................................................................ /15
5. Task 5 ................................................................................................................................ /20
6. Task 6 ................................................................................................................................ /10
7. Task 7 ................................................................................................................................ /10

TOTAL /100*
(*This assignment constitutes 20% of the overall module assessment.)











Division of Computing Science and Mathematics



Assignment 2 Semester: Spring Year: 2019-20

Module Title: Systems Module Code: CSCU9V4
Tutor: Dr Deepayan Bhowmik Division: Computing Science
Submission date: 5:00 pm, Wednesday 8th April 2020

Demonstration date: 10:00 am – 4:00 pm, Thursday 9th April 2020

Nature of Task & Brief Description:
You have done the circuitry for the 'Why-Aye' Pad controller in Assignment 1. You also have had experience
with C in the lab. In this assignment you need to develop algorithms in C to simulate the controller algorithm.
This is an individual assignment.


Max number
of members in
one group
1 Assessment Weighting: 20 %
Objectives
This assignment is designed to address the following learning outcome of the module :

▪ Develop algorithms using C programming language.

Task Details:

The finished assignment must:

a) Complete all tasks as described below.
b) Demonstrate that the code works.
c) Answer question to demonstrate your understanding.
d) Submit the code through CANVAS.




Division of Computing Science and Mathematics



Assignment Specification

The Wi-iTM Controller
Number 910 Fulchester Road in Newcastle is a famous address in
the games industry. Whilst other provincial games manufacturers
took on the big guns in the games industry with products such as
the Phony PlaySatan to compete with the iPhone, and the Welsh
assembly-supported X-Cist 360 and ‘GameBoyo’ (as 'leeked' to the
press recently), a small business operating out of a terraced house
in the North East of England decided to call its revolutionary new
product after the digits in their house number. Thus was born the
NineTenDoor Wi-i (pronounced, as expected in Newcastle, "Why-
Aye"). This somewhat radical new console was designed to be
used by inebriated players, and so had a ruggedised minimalist
controller with only 4 buttons, as shown opposite. This was
dubbed the 'Eee!', reflecting the uncalled-for enthrall when first
seen by a drunk game-player.
Games soon appeared for this new console, such as "You're Me
Best Mate!" a bus-station-platform game, and "Down The Bigg
Market", a multi-person, free-for-all, shoot and stab 'em up. "Are
You Looking At Me?" and "You've Spilled Me Pint!" soon followed, followed by ports of popular
games such as "Spore" but with just the first level available, as deemed appropriate. Shoot 'em Up's,
educational games warning of the perils of drunken drug abuse.
The controller's buttons are designed to be used singly, or in combination with
one or two of the others. There are 14 possible combinations with 2 ‘no
operations’ - it was decided that pressing all four simultaneously was probably
not only impossible for a drunkard, but insensible in terms of game play. The
buttons control a sprite in a game (we're not concerned with the game's details
here) in the following way:


no buttons nothing happens!
 move left (L)
 rotate anti-clockwise (ACW)
 move right (R)
 rotate clockwise (CW)
+ move down (D)
+ move up (U)
+ rotate anticlockwise (ACW) & move left (L) simultaneously
+ rotate clockwise (CW) & move left (L) simultaneously
+ rotate anti-clockwise (ACW) & move right (R) simultaneously
+ rotate clockwise (CW) & move right (R) simultaneously
++ rotate anticlockwise (ACW) & move down (D) simultaneously
++ rotate anticlockwise (ACW) & move up (U) simultaneously
++ rotate clockwise (CW) & move down (D) simultaneously
++ rotate clockwise (CW) & move up (U) simultaneously
+++ nothing happens!

Figure 1: Button control details
Wi-iTM
Division of Computing Science and Mathematics




YOUR TASKS

Task 1:
Develop algorithm written in C that simulated the behaviour of the Wi-i controller as described
in Figure 1 (Button control details). The user should be able to press the number buttons or
arrows keys on the keyboard. Display the output on ‘terminal’ (equivalent to ‘command window’
on a Windows desktop). The code should run in a continuous mode and special key input should
be used to terminate the program.

Task 2:
Improve your task 1 by displaying graphical representation on the console. For example, if your
key combination indicates ‘Move left’ you can display a ← shape (which is composed of a
number of simple characters like ‘*’, ‘+’, ‘-‘, ‘x’, or ‘<’) on your console. Use your imagination on
how to display this innovatively.

Task 3:
Read humidity, pressure and temperature values from the files provided. Read them
continuously and display on the terminal in the following order:
1. Pressure (P),
2. Humidity (H),
3. Temperature (T).
Extend the code so that the user have option to change the order of this display during the run
time. For example if someone press 0 it will prompt the user to enter display order in this
format, PHT or HTP or TPH. This input should NOT be case sensitive. Based on the user input the
display should change its order on the terminal. For example if the input is HPT then the display
should be
1. Humidity (H),
2. Pressure (P),
3. Temperature (T).
User should be able to do this as many times as they want without terminating the program. If
data finishes in any of the files it should start reading from the beginning again.

Task 4:
[This is an optional component and should only be attempted after other tasks are complete.]

Create a bitmap image file of a plain colour (called “mydraw.bmp”). Modify the bitmap file to let it
display the graphics you draw in the console window in Task 2. You should not change the file name.

Apart from doing some extra reading on your own, you may refer to the following webpage about
how to write code to read, write and crop BMP image files:
https://engineering.purdue.edu/ece264/17au/hw/HW15

Task 5:
Demonstrate your code successfully for tasks above. Students will be questioned regarding the
assignment and related understanding. Demonstration viva will be conducted for each student.
Marks will be given based on individual performance for this task.

Division of Computing Science and Mathematics



Task 6:
You need to submit a document which will have individual flowchart for Tasks 1-4. You should
follow flowchart conventions for this task.

Task 7:
You also need to submit the code for Tasks 1 – 4. Higher marks will be award for efficient coding
practices. This includes better use of pointers, modular code design such as more use of
functions etc.

Code should be well commented and well formatted. Marks will be deducted if this is not
maintained.


Outcomes
This work is designed to test your understanding of C programming. Pro-rata marks will be
awarded depending on how many tasks you have completed, how efficiently you have coded
and how creative you have been with tasks for better user interface.

Submission
You will need to submit your work on Canvas as a ZIP file bearing your university username (3
letters + 5 digits, e.g., xyz00001.zip).
• This is individual work.








The deadline for this assignment is
5:00 pm on Wednesday 8th April 2020.
Demonstration: 10:00 am-4:00 pm on
Thursday 9th April 2020
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468