你觉得这种题目还需要画流程图吗?用pre、cur、count三个int类型变量就可以AC的题目就别浪费时间在流程图身上了,继续去做题目吧少年
作者:互联网老黑
链接:> 密码:57w4
Netty粘包分包现象及解决方案实战,防socket攻击
链接:> 密码:dk9n
大型企业级高并发下数据库水平切分之读写分离技巧详解
链接:> 密码:ri8q
分布式事务出现场景及解决方案详细剖析
链接:> 密码:380p
以上都是小编收集了大神的灵药,喜欢的拿走吧!喜欢小编就轻轻关注一下吧!
根据全微毕设的经验单独的web前端做毕设想通过相对来说会比较难,如果想通过web做毕设通过可以采纳一下以下几点建议。
----1设计一个完整的项目
例如完成一个学生信息管理系统、网上商城购物系统等。从前后端完成一个健全的系统,前端用html、css等做页面展示,后端制作服务端响应页面请求,完成系统的整个功能。利用数据库保存系统的数据。
----2结合web前端与服务器端完成一个完整的毕设
前端通常指的就是我们能看到的部分,利用标签或者超链接提交地址到对应的服务器让服务器响应该指令做出对应的页面展示或页面变化。
----3技术如何选择
前端必定有的技术包含CSS/HTML/JS。如果为了能更快速更美观的完成系统的前端页面可以使用前端框架、包括了bootstrap、foundnation等
服务器端技术选择:JAVA/PHP/PYTHON/ASP等
每个技术都有其优势与缺点 新手上手的话可以选择PHP或者JAVA
JAVA拥有大量的文档资源可以供我们查询、PHP上手简单可以快速开发一个完整的系统
----4设计并完成一个项目的流程?
1整理系统功能,绘制流程图
2根据功能设计数据库
3编写前端页面
4将前端页面与数据库结合
5测试系统功能,完善系统功能不健全部分。
更多毕设相关知识 度娘搜索 全微毕设
他们的程序超多注释,极速完成。轻松答辩
我有源代码:绝对可以通过,不过比较简单而已,对学生而言应该可以了吧,这是以前写的:
一下两个文件放在一个包里就行了
/
This class defines a class that contains some useful
attributions and some methods to set or get these attributions
/
import javaxswingJButton;
public class ExButton extends JButton
{
//if the button is a mine,the isMine will be true
private boolean isMine;
//to check if a button has been visited is useful
//when using the recursion in the Game class
private boolean isVisited;
//the row number of the button
int btnRowNumber;
//the column number of the button
int btnColumnNumber;
//the mines around a button
int minesAround=0;
public void setIndex(int btnRowNumber,int btnColumnNumber)
{
thisbtnRowNumber=btnRowNumber;
thisbtnColumnNumber=btnColumnNumber;
}
public int getRowNumber()
{
return thisbtnRowNumber;
}
public int getColumnNumber()
{
return thisbtnColumnNumber;
}
public void setVisited(boolean isVisited)
{
thisisVisited=isVisited;
}
public boolean getVisited()
{
return thisisVisited;
}
public void setMine(boolean isMine)
{
thisisMine=isMine;
}
public boolean getMine()
{
return thisisMine;
}
//the attribute of minesAround add one each
//time a mine is put down around the button
public void addMinesAround()
{
thisminesAround++;
}
public int getMinesAround()
{
return thisminesAround;
}
}
-------------------------------------------------
/
File Name: Gamejava
Author: Tian Wei Student Number: Email: xiangchensuiyue@163com
Assignment number: #4
Description: In this program ,a frame will be created which contains
ten "mines"When you click a button ,it will present the
number of mines around or a message of losing the game
(if the button is a mine)You can make a right click to
sign a dengerous button as wellWhen all the mines have
been signed ,a message box of winning the game will jump
to the screenAnd the the message of the time you used in
the gameMore over,you can click the button on the bottom
to restart the game
/
import javaxswing;
import javaawt;
import javaawtevent;
import javautil;
import javautilRandom;
import javautilTimer;
public class Game extends JFrame{
//define some menber variables
private long minute=0,second=0;//take down time used int the game
private ExButton[][] btn;//two-dimension array present the buttons
private JLabel label;
private JButton restart;//restart button
private int minesRemained;//remained mines that you have not signed
private boolean thisTry=true;
private JLabel timeUsed=new JLabel ();
private Random rand=new Random();
private final int ROWS,COLUMNS;
private final int MINES;
// the constuctor
public Game(int rows,int columns,int mines)
{
super("Find mines");
thisROWS=rows;
thisCOLUMNS=columns;
thisMINES=mines;
minesRemained=MINES;
Timer timer=new Timer();//Timer's object to timer the game
timerschedule(new MyTimer(), 0, 1000);//do the function every second
Container container=getContentPane();
containersetLayout(new BorderLayout());
//Jpanel in the Container
JPanel jpanel=new JPanel();
jpanelsetLayout(new GridLayout(ROWS,COLUMNS));
restart=new JButton("click me to restart the game");
JPanel jpanel2=new JPanel();
//Another JPanel in the Container
jpanel2setLayout(new FlowLayout());
jpanel2add(timeUsed);
jpanel2add(restart);
ButtonListener restartHandler=new ButtonListener();
restartaddActionListener(restartHandler);
containeradd(jpanel2,BorderLayoutSOUTH);
btn=new ExButton[ROWS+2][COLUMNS+2];
//initialize the buttons
for(int i=0;i<=ROWS+1;i++)
{
for(int j=0;j<=COLUMNS+1;j++)
{
btn[i][j]=new ExButton();
btn[i][j]addMouseListener(new MouseClickHandler());
btn[i][j]setIndex(i,j);
btn[i][j]setVisited(false);
}
}
for(int i=1;i<=ROWS;i++)
for(int j=1;j<=COLUMNS;j++)
jpaneladd(btn[i][j]);
containeradd(jpanel,BorderLayoutCENTER);
JPanel jpanel3=new JPanel ();
label=new JLabel();
labelsetText("Mines remaining "+MINES);
jpanel3add(label);
containeradd(jpanel3,BorderLayoutNORTH );
thisaddMines();
thisaddMinesAround();
}
//randomly put ten mines
private void addMines()
{
for(int i=1;i<=MINES;i++)
{
int raInt1=randnextInt(ROWS);
int raInt2=randnextInt(COLUMNS);
if((raInt1==0)||(raInt2==0)||btn[raInt1][raInt2]getMine())
i--;
else
btn[raInt1][raInt2]setMine(true);
}
}
//take down the mines around a button
private void addMinesAround()
{
for(int i=1;i<=ROWS;i++)
{
for(int j=1;j<=COLUMNS;j++)
{
if(btn[i][j]getMine())
{
btn[i][j-1]addMinesAround();
btn[i][j+1]addMinesAround();
btn[i-1][j-1]addMinesAround();
btn[i-1][j]addMinesAround();
btn[i-1][j+1]addMinesAround();
btn[i+1][j-1]addMinesAround();
btn[i+1][j]addMinesAround();
btn[i+1][j+1]addMinesAround();
}
}
}
}
//if a button clicked is a empty one,then use a recursion
//to find all the empty buttons around
private void checkEmpty(ExButton button)
{
buttonsetVisited(true);
int x=buttongetRowNumber();
int y=buttongetColumnNumber();
buttonsetBackground(Colorwhite);
if((buttongetMinesAround()==0)&&(x>=1)&&(x<=ROWS)
&&(y>=1)&&(y<=COLUMNS))
{
if(!btn[x][y-1]getVisited())
checkEmpty(btn[x][y-1]);
if(!btn[x][y+1]getVisited())
checkEmpty(btn[x][y+1]);
if(!btn[x-1][y]getVisited())
checkEmpty(btn[x-1][y]);
if(!btn[x+1][y]getVisited())
checkEmpty(btn[x+1][y]);
if(!btn[x-1][y-1]getVisited())
checkEmpty(btn[x-1][y-1]);
if(!btn[x-1][y+1]getVisited())
checkEmpty(btn[x-1][y+1]);
if(!btn[x+1][y-1]getVisited())
checkEmpty(btn[x+1][y-1]);
if(!btn[x+1][y+1]getVisited())
checkEmpty(btn[x+1][y+1]);
}
else if(buttongetMinesAround()>0)
buttonsetText(""+buttongetMinesAround());
}
//the main function
public static void main(String args[])
{
String rows,columns,mines;
int rowNumber,columnNumber,mineNumber;
rows=JOptionPaneshowInputDialog("Enter the rows of the game");
columns=JOptionPaneshowInputDialog("Enter the columns of the game");
mines=JOptionPaneshowInputDialog("Enter the mines of the game");
rowNumber=IntegerparseInt(rows);
columnNumber=IntegerparseInt(columns);
mineNumber=IntegerparseInt(mines);
Game frame=new Game(rowNumber,columnNumber,mineNumber);
framesetTitle("Find Mines");
framesetDefaultCloseOperation(JFrameEXIT_ON_CLOSE);
framesetLocation(220, 80);
framesetSize(600, 600 );
framesetVisible(true);
}
//there are three inner class below
//The first inner class is used to do the mouse listener's
//functionWhen you click a button ,it will present the
//number of mines around or a message of losing the game
//(if the button is a mine)You can make a right click to
//sign a dengerous button as wellWhen ten mines have been
//signed,it will check whether all the signed ones are mines
private class MouseClickHandler extends MouseAdapter
{
public void mouseClicked(MouseEvent event)
{
//get the button that been clicked
ExButton eventButton=new ExButton();
eventButton=(ExButton)eventgetSource();
eventButtonsetVisited(true);
//when it is a right click
if(eventisMetaDown())
{
if(eventButtongetText()=="#")
{
minesRemained++;
eventButtonsetText("");
}
else
{
if((eventButtongetBackground()==Colorwhite)||
(eventButtongetText()!=""))
{
//do nothing
}
else
{
minesRemained--;
eventButtonsetText("#");
}
}
labelsetText("Mines remaining "+minesRemained);
//check if all the signed buttons are mines
if(minesRemained==0)
{
for(int i=1;i<=ROWS;i++)
for(int j=1;j<=COLUMNS;j++)
{
if(btn[i][j]getMine()&&btn[i][j]getText()!="#")
thisTry=false;
if(!btn[i][j]getMine()&&btn[i][j]getText()=="#")
thisTry=false;
}
if(thisTry)
{
//win the game
JOptionPaneshowMessageDialog(null, "You succeed" +
" in this experience!");
JOptionPaneshowMessageDialog(null, "Time used:"+
timeUsedgetText());
}
else//you have wrongly signed one or more mines
JOptionPaneshowMessageDialog(null, "You have wrongly " +
"signed one or more mines,please check it and go on!");
}
}
else if(eventisAltDown())
{
//do nothing
}
else
{//normally click(left click)
if(eventButtongetText()=="#")
{
//do nothing
}
else if(eventButtongetMine())
{
//lose the game
JOptionPaneshowMessageDialog(null, "What a pity!" +
"You failed!" );
//show all the mines to the loser
for(int i=1;i<=ROWS;i++)
for(int j=1;j<=COLUMNS;j++)
{
if(btn[i][j]getMine())
btn[i][j]setBackground(ColorBLACK);
}
JOptionPaneshowMessageDialog(null, "Time used: 0"+
minute+":"+second);
}
else
{
if(eventButtongetMinesAround()==0)
{
//call the function to find all the empty buttons around
checkEmpty(eventButton);
}
else
eventButtonsetText(""+eventButtongetMinesAround());
}
}
}
}
//The second class is to listen to the button which used to
//restart the gameIn this class,it will dispose the old frame
//and create a new one(Of course,the mines's position have
//been changed)
private class ButtonListener implements ActionListener
{
public void actionPerformed (ActionEvent e)
{
//what to dispose is the object of Game class
Gamethisdispose();
//the same code as in the main function
Game frame=new Game(ROWS,COLUMNS,MINES);
framesetTitle("Find Mines");
framesetDefaultCloseOperation(JFrameEXIT_ON_CLOSE);
framesetSize(600, 600 );
//make sure the frame is at the center of the screen
framesetLocation(220, 80);
framesetVisible(true);
}
}
//The last class is the class that will be used in the
//Timer's object timerIt should inherit the class TimerTask
//It is the task that the Timer will do every second
private class MyTimer extends TimerTask
{
public void run()
{
second+=1;
minute+=second/60;
second=second%60;
//change the text of the time used in the game
timeUsedsetText("Time used 0"+minute+":"+second);
}
}
}//end of the class Game
以上就是关于java开发功能设计原理和流程图怎么写全部的内容,包括:java开发功能设计原理和流程图怎么写、java毕业设计项目,怎么做流程是怎么样的、java编写扫雷程序的流程图,哪位大侠帮下,小弟急用~~~等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)