Introduction to Programming in Java
Project homework (part of 60% regular grade). Group work (4-5 students)
DEADLINE Submission is week 18 to International Office.
INTRODUCTION
1. Objectives of the application
1.Students are able to work well together as a team to produce good design of Java Application.
2.Use previous knowledge in lecture and lab session to create application using Sun Netbeans 8.2 IDE Framework.
3.Able to deploy Array, Inheritance and Exception. If you use more knowledge, you will gain higher scores.
4.Able to demonstrate the concept of design/ development and implementation of software engineering.
2. Required Tasks
2.1 Design and create 1 Java Application (Console or GUI Application) for example Robot Application, Game Application, Employee application or Student Application.
2.2 Must implement Array.
2.3 Must implement Inheritance.
2.4 Must implement Exception.
2.5 Must be able to have a successful run without compile errors or runtime errors.
3. Lesson learnt (what have your learnt minimum 200 words). You will get 25%
student answer = Please write and explain about Java API or libraries that you use, what lessons do you use to achieve your project goals. For example you use Array, Exceptions and Inheritance – you will need to explain why they are useful for your application project.
4. Put your codes and outputs here. You will get 25%
package XOX_Game;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/** @author INSEY
*/
public class DEMO {
private static int[][] winCombinations = new int[][] {
{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, //horizontal wins
{0, 3, 6}, {1, 4, 7}, {2, 5, 8}, //vertical wins
{0, 4, 8}, {2, 4, 6} //diagonal wins
};
private static JButton buttons[] = new JButton[9]; //create 9 buttons
public static void main (String[] args){
gamePanel(); //launch game
}
private static void gamePanel(){
JFrame frame = new JFrame ("MY XOX GAME");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(); //creating a panel with a box like a tic tac toe board
panel.setLayout (new GridLayout (3, 3));
panel.setBorder (BorderFactory.createLineBorder (Color.gray, 3));
panel.setBackground (Color.white);
for(int i=0; i<=8; i++){ //placing the button onto the board
buttons[i] = new MyButton();
panel.add(buttons[i]);
}
frame.getContentPane().add (panel);
frame.pack();
frame.setVisible(true);
frame.setSize(500, 500);// set frame size and let the game begin
}
5. Code explanation You will get 50%
student answer = I DO NOT want students to copy codes so this part please write and explain about your codes, from first line to the last line.
Codes explanation =
What does program do =
Why program is useful for the future =
Plagiarism Declaration: I confirm that this report is my own work. I acknowledge that coping someone else's report will result a zero scoring for entire lab assignment. Name:____________________________
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。