Java代写 | SCC110: Software Development Term 3

本次Java代写是完成一个桌球游戏
SCC110: Software Development Term 3. Programming Project.  
Project Title:  
020 exam cycle due to impacts of the COVID-19 pandemic, this coursework also represent the final  
piece of assessment for SCC110. So it’s time to show us what you can do!  
You have a choice of projects to undertake, to be selected from the three choices below, and you  
need to pick just one of these projects. Read each of them carefully before choosing which project  
to undertake. Please note that the projects state which programming language you must use for that  
project (either C or Java).  
Getting Support  
Due to the ongoing impacts of the COVID-19 pandemic, the University is moving to an alternative  
mode of delivery for Summer Term teaching. As such, we will be replacing the face-to-face studio  
sessions that we would normally use to support the SCC110 term 3 project with online sessions.  
We will be running online SCC110 support sessions every weekday between 10:00 and 12:00 (UK  
time) in weeks 21-25 inclusive. Individual one-on-one support sessions are possible through these  
sessions. Staff and/or teaching assistants will be present at these times to answer your questions  
and provide feedback on your work via Microsoft Teams, which can be accessed through the SCC110

To complete this programming project, you will need access to a computer. In these difficult times,  
with no access to the SCC Learning Labs, we understand that this may not be as easy as normal.  
Hence, these projects have been designed to minimise hardware and software requirements.  
If you have a laptop/desktop computer, you should use this to complete this project. All the  
software you needed is available free of charge.  
For C based projects, we recommend installing a Linux Ubuntu distribution, which will  
include the gcc compiler and the necessary ncurses library as standard.  
If you have problems setting up your computer, ask for help in one of the support sessions.  
Our TAs will be very happy to assist you.  
If you CANNOT gain access laptop/desktop computer, we have provided an online virtual computer  
that is equivalent to the SCC110 lab machines that you can use
Select VMWare Horizon HTML Access (or install the VMWare client if you prefer)  
Log in using your LANCS username and password, and select SCC110  
Use this as you would a normal lab computer:  
If you require any technical support with your development environment, please ask for help  
using the Teams support page.  

SCC110: Software Development Term 3. Programming Project.  
Assessment  
This work will be assessed through continual code review of your work by Teaching Assistants and by  
a code inspection of your work after final submission.  
Your assigned Teaching Assistant will be monitoring the status of your git repository throughout the  
project and will be asking you questions about it via raising issues on your repository. It is YOUR JOB  
to keep your repository up to date, and to answer any questions asked by your TA promptly. This will  
form part of your assessment.  
You are also required to create a short file called README.md in your repository that describes to a  
user precisely how to run your program. This can be either a test file, or use markdown (a simple  
language for adding formatting into text files)
You MUST maintain your work using the SCC110 git server.  
You MUST ensure that your repository is self-contained and can run on an SCC110  
laboratory PC.  
You MUST have a README.md file that describes how to compile and run your program.  
You MUST ensure that your project can be compiled FROM THE COMMAND LINE. Your  
marker WILL NOT be using an IDE such as Eclipse or IntelliJ to compile your program. If  
your marker cannot compile your program using the standard gcc/javac compilers on the  
command line, you WILL RECEIVED A FAIL MARK (F4) for the functionality section.  
FAILURE TO ADHERE TO THE ABOVE WILL RESULT IN A FAIL MARK (F4) BEING RECORDED.  
SCC110 Git Server and Submission  
We will be using git again for version control. We have set up our own git server specifically for  
SCC.110 which can be accessed at
Most of you have already used this server as a final step for the ‘Hoppers’ assessment.  
If you have forgotten the password for this server, click on the ‘forgot password?’ link which is to the  
right of the ‘Sign in’ button. n.b. you must use your Lancaster email address. You can see this listed  
on your Microsoft Teams profile so check you are using the correct one if things aren’t working.  
For this assignment, we have already created repository for you. You should clone this repository,  
make commits and push these commits back to the server throughout your project. The repository is  
As part of the assessment, you will gain marks for making regular commits with sensible and relevant  
commit messages. We will analyse your use of the repository and will add metrics data in a separate  
branch of the repository. Issues will be created which will allow your mentor to mark your progress  
during the project. The feedback made by your mentor will help you to progress your work on the  
project.

SCC110: Software Development Term 3. Programming Project.  
Marking Scheme  
Your work will be marked based on the following four categories. Your final grade will be determined  
based on a weighted mean of these grades according to the weighting shown in the table below.  
Project Functionality  
See individual project descriptions below for indicative levels of the  
functionality required.  
50%  
20%  
Code Structure and Elegance  
Modularity of code  
Use of appropriate data types and libraries  
Use of appropriate language constructs (arrays, loops, functions,  
methods, classes)  
Code Style  
Appropriate comments, code indentation  
Appropriate name/scope of variables and functions / methods  
10%  
10%  
10%  
Communication  
Quality of the README.md guide  
Ability to answer questions raised by TAs via git issues  
Use of GIT version control  
Clean and regular commits  
Appropriate commit messages  
In all cases a grade descriptor (A, B, C, D, F) will be used to mark your work in each category. The  
following sections provide an indication of the level of functionality expected.  
Markers can also recommend the award of a distinction (+) category overall if they feel a piece of  
work exhibits clearly outstanding practice. If you feel your work warrants a distinction category.

SCC110: Software Development Term 3. Programming Project.  
Project Title:  
Language:  
Project 1: Defender  
C
Project Overview:  
Williams Electronics released the original arcade console ‘Defender’ in 1981. The aim of the game is  
pretty simple. Aliens are trying to abduct your planet’s citizens by ‘tractor beaming them’ from the  
ground and taking them by lifting them to the top of the screen. Once all your population has been  
abducted by the aliens, it’s game over. Fortunately, you have a powerful spaceship with an array of  
weapons at your disposal to destroy the alien horde.

Working program that:  
Basic single player game with a ship, working controls, and firing  
No working program demonstrated, or program does not meet any requirements  
listed above.

SCC110: Software Development Term 3. Programming Project.  
Project Title:  
Language:  
Project 2: Cool Pool  
Java  
Project Overview:  
Simulations are excellent ways to test your ability to implement programs to well-defined  
specifications… The aim of this project is to make use of an advanced version of the GameArena  
classes you used earlier this year to implement a simple graphical simulation of 8 ball pool.  
Figure 3: An Example Pool Application using GameArena  
Your final pool simulation should:  
Display a simple top down view of a pool table, similar to that shown above.  
Allow the user to play a 2 player game of pool against another human player (no need for a  
computer opponent… although this would be very cool indeed).  
Place the balls in the appropriate position at the start of the game.  
Allow players to select the direction and power of their shot in a user friendly manner.  
Display the movement of the balls around the table accurately, including balls bouncing off  
cushions, bounding off one another and friction.  
Implement the basic rules of the 8 ball pool, including placing the white ball at the start of  
the game, potting balls, winning the game and fouls caused by the player potting the white,

SCC110: Software Development Term 3. Programming Project.  
hitting a ball of the wrong colour or no ball at all.
HINT: Some sample code to determine the direction and speed after two balls collide is provided  
below. You are free to use/refactor this code into your project…  
Marking Scheme:  
Marks will be awarded according to the marking scheme shown at the start of this document. Marks  
for the ‘Functionality’ section will be awarded based on individual merit, but the following table  
gives an indicative overview of the level of functionality expected for each grade band:  
A:  
Working program that meets the criteria for a B, plus:  
Support for 2 player operation, including determining when each player  
should take a turn.  
Detection of basic fouls (potting white, hitting wrong colour first, not hitting a  
ball) and continuing play according to the rules of 8 ball pool.  
Detection of when a player wins the game.  
B:  
C:  
Working program that meets the criteria for a C, plus:  
Impacts between multiple balls accurately implemented.  
All balls bounce off cushions accurately.  
All balls handle friction appropriately.  
Balls can be potted.  
Working program that meets the criteria for a D, plus:  
User friendly means to define white ball’s trajectory.  
White ball bounces off cushions accurately.  
White ball comes to rest due to friction appropriately.  
Code detects when a white ball hits another ball.  
D:  
F:  
Working program that:  
Shows a viable Graphical User Interface (GUI).  
All balls are shown at the appropriate start location.  
Initial trajectory of the white ball can be defined somehow.  
No working program demonstrated, or program does not meet any requirements  
listed above.  
If you complete the above, you could look to support variants of pool (nine ball pool, or even  
snooker), or even consider online play, so you can play with your classmates even though we are all  
working from home!  

SCC110: Software Development Term 3. Programming Project.  
Ball Deflection Algorithm:  
This algorithm when given the position and velocity of two balls, will calculate the resultant velocity  
of those two balls after collision. You are free to cut/paste and use this code as part of your project.  
You might want to consider how to refactor it to be more object oriented though…ꢃ  
public void deflect()  
{
/
/
double xPosition1, xPosition2, yPosition1, yPosition2;  
double xSpeed1, xSpeed2, ySpeed1, ySpeed2;  
/ The position and speed of each of the two balls in the x and y axis before collision.  
/ YOU NEED TO FILL THESE VALUES IN AS APPROPRIATE…  
/
double p1InitialMomentum = Math.sqrt(xSpeed1 * xSpeed1 + ySpeed1 * ySpeed1);  
double p2InitialMomentum = Math.sqrt(xSpeed2 * xSpeed2 + ySpeed2 * ySpeed2);  
/ Calculate initial momentum of the balls… We assume unit mass here.  
/
/ calculate motion vectors  
double[] p1Trajectory = {xSpeed1, ySpeed1};  
double[] p2Trajectory = {xSpeed2, ySpeed2};  
/
/ Calculate Impact Vector  
double[] impactVector = {xPosition2 – xPosition1, yPosition2 – yPosition1};  
double[] impactVectorNorm = normalizeVector(impactVector);  
/
/ Calculate scalar product of each trajectory and impact vector  
double p1dotImpact = Math.abs(p1Trajectory[0] * impactVectorNorm[0] + p1Trajectory[1] * impactVectorNorm[1]);  
double p2dotImpact = Math.abs(p2Trajectory[0] * impactVectorNorm[0] + p2Trajectory[1] * impactVectorNorm[1]);  
/
double[] p1Deflect = { -impactVectorNorm[0] * p2dotImpact, -impactVectorNorm[1] * p2dotImpact };  
double[] p2Deflect = { impactVectorNorm[0] * p1dotImpact, impactVectorNorm[1] * p1dotImpact };  
/ Calculate the deflection vectors – the amount of energy transferred from one ball to the other in each axis  
/
double[] p1FinalTrajectory = {p1Trajectory[0] + p1Deflect[0] – p2Deflect[0], p1Trajectory[1] + p1Deflect[1] – p2Deflect[1]};  
double[] p2FinalTrajectory = {p2Trajectory[0] + p2Deflect[0] – p1Deflect[0], p2Trajectory[1] + p2Deflect[1] – p1Deflect[1]};  
/ Calculate the final trajectories  
/
/ Calculate the final energy in the system.  
double p1FinalMomentum = Math.sqrt(p1FinalTrajectory[0] * p1FinalTrajectory[0] + p1FinalTrajectory[1] * p1FinalTrajectory[1]);  
double p2FinalMomentum = Math.sqrt(p2FinalTrajectory[0] * p2FinalTrajectory[0] + p2FinalTrajectory[1] * p2FinalTrajectory[1]);  
/
/ Scale the resultant trajectories if we’ve accidentally broken the laws of physics.  
double mag = (p1InitialMomentum + p2InitialMomentum) / (p1FinalMomentum + p2FinalMomentum);  
/
/ Calculate the final x and y speed settings for the two balls after collision.  
xSpeed1 = p1FinalTrajectory[0] * mag;  
ySpeed1 = p1FinalTrajectory[1] * mag;  
xSpeed2 = p2FinalTrajectory[0] * mag;  
ySpeed2 = p2FinalTrajectory[1] * mag;  
}
/
**  
*
Converts a vector into a unit vector.  
*
Used by the deflect() method to calculate the resultnt direction after a collision.  
*/  
private double[] normalizeVector(double[] vec)  
{
double mag = 0.0;  
int dimensions = vec.length;  
double[] result = new double[dimensions];  
for (int i=0; i < dimensions; i++)  
mag += vec[i] * vec[i];  
mag = Math.sqrt(mag);  
if (mag == 0.0)  
{
result[0] = 1.0;  
for (int i=1; i < dimensions; i++)  
result[i] = 0.0;  
}
else  
{
for (int i=0; i < dimensions; i++)  
result[i] = vec[i] / mag;  
}
return result;  
}

SCC110: Software Development Term 3. Programming Project.  
Project Title:  
Language:  
Project 3: Data Structure Visualisation  
Java  
Project Overview:  
The aim of this project is to write a Java program to assist with the teaching of the abstract data  
structures discussed in SCC120. It will give you an excellent opportunity to explore building and  
visualising different data structures. The process of building these data structures will also aid in  
your understanding of both data structures and object orientation.  
This project requires you to build a number of dynamic data structures in Java from first principles  
(that means you do this part without using any classes other than your own), then using the  
GameArena and Swing classes visualise these in a way that would help users understand these data  
structures.  

SCC110: Software Development Term 3. Programming Project.  
Project Requirements:  
Your task is to implement and visualise an educational program that can represent abstract data  
structures such as an array, linked list or hash table. Your program should implement one or more of  
these data structures in Java from first principles (without using classes such as the Java Collections  
API).  
More specifically, your program should:  
Include classes to represent a data structures such as an array, linked list and hash table.  
These classes should support the ability to add, remove and search for elements. The  
elements themselves need not be particularly complex each simply holding say, a String or  
an integer.  
Provide an educational visualisation based on the GameArena classes so that users can see a  
representation of your data structure on the screen. Your visualisation should update  
dynamically as items are added/removed from a data structure. To assist you in this task,  
new capabilities have been added to the GameArena classes, including the ability to draw  
lines, arrows and text… so be sure to get the latest GameArena classes before you get  
started. You’ll find the latest version in this git repository:
Include a simple Swing user interface to allow the user to add, remove and search for  
elements in the data structure. Your visualisation should also (ideally) include a simple  
animation to illustrate the operation of the data structures supported by your program.  
Guidance:  
The design of the object structure for this project is quite important, so start with a simple data  
structure such as an array, then work toward the linked list and hash table. Think carefully about  
what classes you will create for an element and how you might use object references to build the  
dynamic data structures. Also consider the relationship between these elements, object references  
and GameArena classes for a Ball and Line.  
You may wish to sketch your design on paper before you begin and discuss it with one of the SCC110  
TAs during one of the online support sessions.