Professional Documents
Culture Documents
19436768
BSc Computing
University of Northampton
Submission: Sunday, 4th Aug 2019, by 23h59.
Year 1 (Level 4) CSY1020 – Problem Solving & Programming
TABLE OF CONTENTS
University of Northampton. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1. INTRODUCTION & PROBLEM SPECIFICATION . . . . . . . . .. . . . . . .. . . . . . . . . . 3
1.1. Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Error! Bookmark not defined.
1.2. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 5
2. ANALYSIS. . . . . . . . . . . . .. . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. System Requirements: Essential (Graphical User Interface) . . . . . . . . . . . . 6
2.2. System Requirements: Additional (Functionality & Complexity). . . . . . . . . . 6
3. DESIGN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
3.1. GUI Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . 7
3.2. Design (Pseudo-code/Flowcharts). . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 8
4. IMPLEMENTATION . . . . . . . .. . . . . . . .. . . . . . . .. . . . . .. . . .. . . .. . . . . . . . . 9
5. TESTING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
System Requirements: Essential (Graphical User Interface): . . . . . . .. . . . . . . . . .
.......................................................................... Error! Bookmark not defined.
System Requirements: Additional (Functionality & Complexity):. . . . . . . . . . . . . .
.......................................................................... Error! Bookmark not defined.
6. CONCLUSION & RECOMMENDATIONS . . . . . . . . . . . . . . . .. . . . . . . . . . . . . .
Error! Bookmark not defined.
6.1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Error! Bookmark not defined.
6.2. System Requirements: Essential (Graphical User Interface). . . . . . . .. . . .
Error! Bookmark not defined.
6.3. System Requirements: Additional (Functionality & Complexity). . . . . . . . .
Error! Bookmark not defined.
REFERENCES. . . . . . . . . . . . . . . . . . . . . .. . . . . . . .. . . . . . . . . . . . . . . . . . . . . 17
BIBLIOGRAPHY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . .. . . . .
.......................................................................... Error! Bookmark not defined.
TABLE OF FIGURE
LIST OF TABLES
This is Problem Solving and Programming assignment2. This assignment is associated to set up
the game. This is composed by using java. Scheme is granted in the Nile. Different function should
be added in the given scenario. Using the Green Scenario included, produce a technical report
and accompanying Java GUI application, simulating control of car to navigate around a course
using left, right, up and down buttons/keys. There is fame created which size is 810 x 680. In the
fame there is three panel added, where in the first panel there is wall image is added, black space
image is added and car is added. In the second panel there is fourteen buttons and six text field
added. In the text field there is option text field, square text field, direction text field and digital
timer text field is added. where digital timers show hours, minutes and seconds. In buttons there
is up, down, right and left buttons is added which moves the car is different direction. In the
buttons there is option1,option2, option3 and exit button is added. there is compass added in other
button, which show direction of the car. In other panel there is three buttons is added, where in the
buttons there is Act, Run, Reset is added. there is also speed testing is added. There is also menu
bar. In the menu bar there is scenario, edit, controls and helps.
1.1. Aim
When > button was pressed then car moves forward direction .
1.2. Objectives
The car should only move inside the area bounded by the two red walls.
If the come to contact with the bounded walls then the game will stop.
The car ought to move one whole black at every time, at movement key button through a
direction button (<, >, ^, v) is clicked in every time ( If movement is possible).
The scheme be must by the solution which is provided.
The completion of main solution must be done using the act button (accessing the drive car)
way within the car crush class.
From the given scenario we have Act, Run, Reset buttons in the third panel . when you press the act button
the car run one step forward in between two red wall, the car round the scenario. when you press the run
button car run automatically, when you pause the run button the car stop. When the reset button was pressed
the game again started.
There are fourteen buttons used in the scenario . where four button is used for option 1 , option 2 , option 3
and Exit in second panel. In the option we have reached different level by the option ,where exit button close
the game . There are three button which is used in third panel, they are Act, Run and Reset . when we have
pressed the Act button the car run one step forward between the two walls .when we pressed the Run button
the car run automatically. When we pressed the Reset button the game again restart. In the second panel
there are nine buttons which is used run the car forward , backward ,upward and downward .this button is
used for move the appropriate direction by one square for each press. Where the symbol is(>, <, ^, v), where
the five button is blank. There is also compass icon button that should illustrate the current direction for the
car in the second panel . there is option , square and direction button. By the use of option button we reached
the different level option1 , option2,and option3 . where square button give the location of car. The direction
button was used for car of direction . In the second panel there is also a digital timer which is used for the
time of car run . this shown how much time be considered the car when its run. There are three text field
which show hours, minutes, and second. This whole panel is created in frame which size is 810 * 650. The f
tittle frame application name is set as CCarCrash.
In this screenshot , we would show that how the panel is set. There are 3 panel add in the scenario
,they are panel1, panel 2 and panel3. Different panel had different size and there background colour.
This code to move car in right direction .this method name is set as can\move right. Right button is i.e. ‘>’.
When this button is clicked car run is right direction . and the compass show the car moves in east direction .
This code to move car in left direction .this method name is set as can\move left. Left button is i.e. ‘<’.
When this button is clicked car run is left direction . and the compass show the car moves in west direction .
This code to move car in up direction .this method name is set as can move upward. Up button is i.e. ‘^’.
When this button is clicked car run is upward direction . and the compass show the car moves in north
direction .
This code to move car in down direction .this method name is set as can move downward. down button is
i.e. ‘V’. When this button is clicked car run is downward direction . and the compass show the car moves in
south direction .
When act button is pressed the car run one step forward in east direction
When the run button is pressed the car run automatically in direction .and the compass also shown their
direction east , west, north and south respectively.
When the reset button is pressed the game restart .and start new game.
In this the whole scenario is tested to detect whether there is problem or not and limitations also and it is
done as giving some task and observing it and reporting it.
3. Down Key (V) is pressed The car should run in The car run in south
downward direction direction
4. Up key (^) is pressed The car should run in The car run in north
upward direction direction
5. Act button is pressed The car should run in Car run forward and
one step forward downward when there
direction is possible
6. Run Button is Pressed The car should run in Car run automatically in
automatically and their direction when
change their direction there is possible
On concluding the whole report, talking from introduction part, where author have stated and described
about the assignment and scenario. Introduction to the task describes the tasks which author have done. All
rules and basic, intermediate requirements are fulfilled. Each task is introduced and analyzed word by word.
The whole scenario is analyzed to detect problems and detected problem are solved. Complex parts are
made easy with the help of algorithms and flowcharts. Then whole scenario is taken to the testing portion
where it is tested with all the possible inputs to detect extra errors and limitations of code. Completing basic
requirement, the car run in all direction with the help of respective movement keys and finally reaches at its
destiny. Intermediate features like when the car touches the wall the car not move massage be shown The
extra features like functioning of act, run, reset button functions very well.
Here in this assignment all the requirements are fulfilled, however there are some limitations and weakness
that are still hidden inside code. Some of the limitations are non-function of Option2 and Option 3, menu
items, etc. If I had more time would have tried to solve them and add some advance features like game
sound, obstacles, function of option2 and option3 etc.
7. REFERENCES
https://www.tutorialspoint.com/javaexamples/index.htm
https://www.eclipse.org
www.freebookcentre.net/JavaTech/javaCategory.html
http://math.hws.edu/javanotes/c7/index.html
http://math.hws.edu/eck/cs124/downloads/javanotes8-example-programs.zip
http://math.hws.edu/javanotes/source/index.html