十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
正好我閑著,給你寫一個(gè)吧。

創(chuàng)新互聯(lián)專注于惠山企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè),電子商務(wù)商城網(wǎng)站建設(shè)?;萆骄W(wǎng)站建設(shè)公司,為惠山等地區(qū)提供建站服務(wù)。全流程按需求定制網(wǎng)站,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)
我寫的這個(gè)評委分?jǐn)?shù)是在代碼里固定到數(shù)組里了,如果你需要運(yùn)行時(shí)手動輸入評分,可以將oldScores里的數(shù)據(jù)改成手動輸入就行了(這個(gè)不用我再寫了吧,如果不會再追問,再告訴你)。
你先新建一個(gè)類,將下面的main方法全部復(fù)制進(jìn)去就能運(yùn)行了,自己看一下吧。
/**?主方法?*/
public?static?void?main(String[]?args)
{
/**?保存原始評分的數(shù)組(如果你需要運(yùn)行時(shí)手動輸入分?jǐn)?shù),將?oldScores中的數(shù)據(jù)改成手動輸入就行了?*/
double[]?oldScores?=?{15,?77,?55,?88,?79,?98,?67,?89,?68,?88};
/**?最終將用來保存排序后的數(shù)組?*/
double[]?scores?=?new?double[oldScores.length];
double?temp;
/**?平均分?*/
double?avg?=?0;
int?k;
/**?將原始評分放入最終排序數(shù)組?*/
for?(int?i?=?0;?i??oldScores.length;?i++)
{
scores[i]?=?oldScores[i];
}
/**?開始排序?*/
for?(int?i?=?0;?i??scores.length?-?1;?i++)
{
k?=?i;
for?(int?j?=?i?+?1;?j??scores.length;?j++)
{
if?(scores[k]??scores[j])
{
k?=?j;
}
}
if?(i?!=?k)
{
temp?=?scores[k];
scores[k]?=?scores[i];
scores[i]?=?temp;
}
}
/**?計(jì)算去掉最高分和最低分之后的和?*/
double?sum?=?0;
/**?記錄計(jì)算平均分的分?jǐn)?shù)個(gè)數(shù)?*/
double?num?=?0;
for?(int?i?=?1;?i??scores.length?-?1;?i++)
{
num++;
sum?+=?scores[i];
}
/**?計(jì)算平均分?*/
avg?=?sum?/?num;
/**?最公平的肯定不是在scores數(shù)組兩端?*/
double?zgp?=?0;
double?cha?=?0;
/**?標(biāo)記與平均值差值最小的分?jǐn)?shù)位置?*/
int?flag?=?0;
/**?開始尋找最公平評分?*/
for?(int?i?=?1;?i??scores.length?-?1;?i++)
{
/**?為cha賦初始值,注意比較差值要使用絕對值比較?*/
if?(i?==?1)
{
cha?=?Math.abs(scores[i]?-?avg);
}
double?cha1?=?Math.abs(scores[i]?-?avg);
if?(cha1??cha)
{
cha?=?cha1;
flag?=?i;
}
}
zgp?=?scores[flag];
/**?由于最不公平的分?jǐn)?shù)肯定在scores數(shù)組的第一個(gè)或者是最后一個(gè)?*/
double?bgp?=?0;
if?(Math.abs(scores[0]?-?avg)??Math.abs(scores[scores.length?-?1]?-?avg))
{
bgp?=?scores[0];
}
else
{
bgp?=?scores[scores.length?-?1];
}
/**?全部計(jì)算完成,下面開始輸出結(jié)果?*/
System.out.println("原始評委分?jǐn)?shù)如下:");
for?(int?i?=?0;?i??oldScores.length;?i++)
{
System.out.print(oldScores[i]?+?",?");
}
System.out.println();
System.out.println("排序后分?jǐn)?shù)如下:");
for?(int?i?=?0;?i??scores.length;?i++)
{
System.out.print(scores[i]?+?",?");
}
System.out.println();
System.out.println("去掉最高分和最低分后平均分:"?+?avg);
System.out.println("最公平分?jǐn)?shù):"?+?zgp);
System.out.println("最不公平分?jǐn)?shù):"?+?bgp);
}
你說的java源代碼是指編譯成的class文件前的java文件。
當(dāng)我們運(yùn)行.java文件時(shí),它會被系統(tǒng)編譯成.class文件,例如Test.java編譯之后就是Test.class,
源文件就是指Test.java文件,
一般部署項(xiàng)目時(shí),有.class文件就可以發(fā)布運(yùn)行了,但是如果想修改這個(gè)系統(tǒng),.class是不能修改的,要有.java文件才能修改
也可以上網(wǎng)去下反編譯軟件,就是能把.class文件大部分還原成.java文件的工具,但不是100%還原,而且如果不是正版的,小心有毒啊,什么的。
連連看java源代碼
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class lianliankan implements ActionListener
{
JFrame mainFrame; //主面板
Container thisContainer;
JPanel centerPanel,southPanel,northPanel; //子面板
JButton diamondsButton[][] = new JButton[6][5];//游戲按鈕數(shù)組
JButton exitButton,resetButton,newlyButton; //退出,重列,重新開始按鈕
JLabel fractionLable=new JLabel("0"); //分?jǐn)?shù)標(biāo)簽
JButton firstButton,secondButton; //分別記錄兩次被選中的按鈕
int grid[][] = new int[8][7];//儲存游戲按鈕位置
static boolean pressInformation=false; //判斷是否有按鈕被選中
int x0=0,y0=0,x=0,y=0,fristMsg=0,secondMsg=0,validateLV; //游戲按鈕的位置坐標(biāo)
int i,j,k,n;//消除方法控制
public void init(){
mainFrame=new JFrame("JKJ連連看");
thisContainer = mainFrame.getContentPane();
thisContainer.setLayout(new BorderLayout());
centerPanel=new JPanel();
southPanel=new JPanel();
northPanel=new JPanel();
thisContainer.add(centerPanel,"Center");
thisContainer.add(southPanel,"South");
thisContainer.add(northPanel,"North");
centerPanel.setLayout(new GridLayout(6,5));
for(int cols = 0;cols 6;cols++){
for(int rows = 0;rows 5;rows++ ){
diamondsButton[cols][rows]=new JButton(String.valueOf(grid[cols+1][rows+1]));
diamondsButton[cols][rows].addActionListener(this);
centerPanel.add(diamondsButton[cols][rows]);
}
}
exitButton=new JButton("退出");
exitButton.addActionListener(this);
resetButton=new JButton("重列");
resetButton.addActionListener(this);
newlyButton=new JButton("再來一局");
newlyButton.addActionListener(this);
southPanel.add(exitButton);
southPanel.add(resetButton);
southPanel.add(newlyButton);
fractionLable.setText(String.valueOf(Integer.parseInt(fractionLable.getText())));
northPanel.add(fractionLable);
mainFrame.setBounds(280,100,500,450);
mainFrame.setVisible(true);
}
public void randomBuild() {
int randoms,cols,rows;
for(int twins=1;twins=15;twins++) {
randoms=(int)(Math.random()*25+1);
for(int alike=1;alike=2;alike++) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
while(grid[cols][rows]!=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
}
this.grid[cols][rows]=randoms;
}
}
}
public void fraction(){
fractionLable.setText(String.valueOf(Integer.parseInt(fractionLable.getText())+100));
}
public void reload() {
int save[] = new int[30];
int n=0,cols,rows;
int grid[][]= new int[8][7];
for(int i=0;i=6;i++) {
for(int j=0;j=5;j++) {
if(this.grid[i][j]!=0) {
save[n]=this.grid[i][j];
n++;
}
}
}
n=n-1;
this.grid=grid;
while(n=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
while(grid[cols][rows]!=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
}
this.grid[cols][rows]=save[n];
n--;
}
mainFrame.setVisible(false);
pressInformation=false; //這里一定要將按鈕點(diǎn)擊信息歸為初始
init();
for(int i = 0;i 6;i++){
for(int j = 0;j 5;j++ ){
if(grid[i+1][j+1]==0)
diamondsButton[i][j].setVisible(false);
}
}
}
public void estimateEven(int placeX,int placeY,JButton bz) {
if(pressInformation==false) {
x=placeX;
y=placeY;
secondMsg=grid[x][y];
secondButton=bz;
pressInformation=true;
}
else {
x0=x;
y0=y;
fristMsg=secondMsg;
firstButton=secondButton;
x=placeX;
y=placeY;
secondMsg=grid[x][y];
secondButton=bz;
if(fristMsg==secondMsg secondButton!=firstButton){
xiao();
}
}
}
public void xiao() { //相同的情況下能不能消去。仔細(xì)分析,不一條條注釋
if((x0==x (y0==y+1||y0==y-1)) || ((x0==x+1||x0==x-1)(y0==y))){ //判斷是否相鄰
remove();
}
else{
for (j=0;j7;j++ ) {
if (grid[x0][j]==0){ //判斷第一個(gè)按鈕同行哪個(gè)按鈕為空
if (yj) { //如果第二個(gè)按鈕的Y坐標(biāo)大于空按鈕的Y坐標(biāo)說明第一按鈕在第二按鈕左邊
for (i=y-1;i=j;i-- ){ //判斷第二按鈕左側(cè)直到第一按鈕中間有沒有按鈕
if (grid[x][i]!=0) {
k=0;
break;
}
else //K=1說明通過了第一次驗(yàn)證
}
if (k==1) {
linePassOne();
}
}
if (yj){ //如果第二個(gè)按鈕的Y坐標(biāo)小于空按鈕的Y坐標(biāo)說明第一按鈕在第二按鈕右邊
for (i=y+1;i=j ;i++ ){ //判斷第二按鈕左側(cè)直到第一按鈕中間有沒有按鈕
if (grid[x][i]!=0){
k=0;
break;
}
else
}
if (k==1){
linePassOne();
}
}
if (y==j ) {
linePassOne();
}
}
if (k==2) {
if (x0==x) {
remove();
}
if (x0x) {
for (n=x0;n=x-1;n++ ) {
if (grid[n][j]!=0) {
k=0;
break;
}
if(grid[n][j]==0 n==x-1) {
remove();
}
}
}
if (x0x) {
for (n=x0;n=x+1 ;n-- ) {
if (grid[n][j]!=0) {
k=0;
break;
}
if(grid[n][j]==0 n==x+1) {
remove();
}
}
}
}
}
for (i=0;i8;i++ ) { //列
if (grid[i][y0]==0) {
if (xi) {
for (j=x-1;j=i ;j-- ) {
if (grid[j][y]!=0) {
k=0;
break;
}
else
}
if (k==1) {
rowPassOne();
}
}
if (xi) {
for (j=x+1;j=i;j++ ) {
if (grid[j][y]!=0) {
k=0;
break;
}
else
}
if (k==1) {
rowPassOne();
}
}
if (x==i) {
rowPassOne();
}
}
if (k==2){
if (y0==y) {
remove();
}
if (y0y) {
for (n=y0;n=y-1 ;n++ ) {
if (grid[i][n]!=0) {
k=0;
break;
}
if(grid[i][n]==0 n==y-1) {
remove();
}
}
}
if (y0y) {
for (n=y0;n=y+1 ;n--) {
if (grid[i][n]!=0) {
k=0;
break;
}
if(grid[i][n]==0 n==y+1) {
remove();
}
}
}
}
}
}
}
public void linePassOne(){
if (y0j){ //第一按鈕同行空按鈕在左邊
for (i=y0-1;i=j ;i-- ){ //判斷第一按鈕同左側(cè)空按鈕之間有沒按鈕
if (grid[x0][i]!=0) {
k=0;
break;
}
else //K=2說明通過了第二次驗(yàn)證
}
}
if (y0j){ //第一按鈕同行空按鈕在與第二按鈕之間
for (i=y0+1;i=j ;i++){
if (grid[x0][i]!=0) {
k=0;
break;
}
else
}
}
}
public void rowPassOne(){
if (x0i) {
for (j=x0-1;j=i ;j-- ) {
if (grid[j][y0]!=0) {
k=0;
break;
}
else
}
}
if (x0i) {
for (j=x0+1;j=i ;j++ ) {
if (grid[j][y0]!=0) {
k=0;
break;
}
else
}
}
}
public void remove(){
firstButton.setVisible(false);
secondButton.setVisible(false);
fraction();
pressInformation=false;
k=0;
grid[x0][y0]=0;
grid[x][y]=0;
}
public void actionPerformed(ActionEvent e) {
if(e.getSource()==newlyButton){
int grid[][] = new int[8][7];
this.grid = grid;
randomBuild();
mainFrame.setVisible(false);
pressInformation=false;
init();
}
if(e.getSource()==exitButton)
System.exit(0);
if(e.getSource()==resetButton)
reload();
for(int cols = 0;cols 6;cols++){
for(int rows = 0;rows 5;rows++ ){
if(e.getSource()==diamondsButton[cols][rows])
estimateEven(cols+1,rows+1,diamondsButton[cols][rows]);
}
}
}
public static void main(String[] args) {
lianliankan llk = new lianliankan();
llk.randomBuild();
llk.init();
}
}
//old 998 lines
//new 318 lines
簡單的說,所謂調(diào)查問卷的信度是指這個(gè)問卷是不是可靠的,這個(gè)包含多層含義,比如說這份問卷是不是多次重復(fù)做結(jié)果都接近等等。
效度是指這個(gè)問卷是不是考察出了你想要考察的結(jié)果,一般這個(gè)會和一個(gè)校標(biāo)做校標(biāo)關(guān)聯(lián)系數(shù)。
信度一般用阿爾法系數(shù)做檢驗(yàn)
效度一般用T檢驗(yàn),顯著性差異指數(shù)P檢驗(yàn)。
一般應(yīng)該先用小樣本做信度和效度,但是做效度的樣本也不應(yīng)該低于60人。然后再做推廣。
還有你這種量表是否應(yīng)該在做效度時(shí)用校標(biāo)關(guān)聯(lián)系數(shù)呢,但這又需要你有新的校標(biāo)。
因?yàn)椴惶私饩唧w情況,所以先這么說,在做的時(shí)候你要遇到什么問題,你在問我哈。還有建議關(guān)于怎么做信度和效度,你還是看一下相關(guān)書籍。我覺得這還是很有必要的。
一、信度系數(shù)與信度指數(shù)
大部分情況下,信度是以信度系數(shù)為指標(biāo),它是一種相關(guān)系數(shù)。常常是同一被試樣本所得到的兩組資料的相關(guān),理論上說就是真分?jǐn)?shù)方差與實(shí)得分?jǐn)?shù)方差的比值,公式為:
r(xx)=r^2(xt)=S^2(t)/S^2(x)
公式中r^2(xt)是真分?jǐn)?shù)標(biāo)準(zhǔn)差與實(shí)得分?jǐn)?shù)標(biāo)準(zhǔn)差的比值,稱作信度系數(shù),公式為:
r(xt)=S(t)/S(x)
可見信度指數(shù)的平方就是信度系數(shù)。
二、測量標(biāo)準(zhǔn)誤
信度系數(shù)僅表示一組測量的實(shí)得分?jǐn)?shù)與真分?jǐn)?shù)的符合程度,但并沒有直接指出個(gè)人測驗(yàn)分?jǐn)?shù)的變異量。我們可以用一組被試兩次測量結(jié)果來代替對同一個(gè)人的反復(fù)施測,于是有了信度的另一個(gè)指標(biāo),公式為:
SE=S(x)√1-r(xx)
公式中SE為測量的標(biāo)準(zhǔn)誤,S(x)是所得分?jǐn)?shù)的標(biāo)準(zhǔn)差,r(xx)為測驗(yàn)的信度系數(shù),從公式我們可以看出測量的標(biāo)準(zhǔn)誤與信度之間有互為消長的關(guān)系:信度越高,標(biāo)準(zhǔn)誤越小,信度越低,標(biāo)準(zhǔn)誤越大。
p value 和t value 我在百度百科上沒看到,你自己再找找吧
在Eclipse中查看JDK類庫的源代碼
設(shè)置:
1.點(diǎn) “window”- "Preferences" - "Java" - "Installed JRES"
2.此時(shí)"Installed JRES"右邊是列表窗格,列出了系統(tǒng)中的 JRE 環(huán)境,選擇你的JRE,然后點(diǎn)邊上的 "Edit...", 會出現(xiàn)一個(gè)窗口(Edit JRE)
3.選中rt.jar文件的這一項(xiàng):“c:\program files\java\jre_1.5.0_06\lib\rt.jar”?
點(diǎn) 左邊的“+” 號展開它
4.展開后,可以看到“Source Attachment:(none)”,點(diǎn)這一項(xiàng),點(diǎn)右邊的按鈕“Source Attachment...”, 選擇你的JDK目錄下的 “src.zip”文件
5.一路點(diǎn)"ok",結(jié)束。
dt.jar是關(guān)于運(yùn)行環(huán)境的類庫,主要是swing的包?
tools.jar是關(guān)于一些工具的類庫?
rt.jar包含了jdk的基礎(chǔ)類庫,也就是你在java doc里面看到的所有的類的class文件
使用:
可以在 Java 源代碼編輯器或代碼片段編輯測試窗中選擇類型、方法或字段的名稱,然后對元素的定義打開編輯器。
在 Java 編輯器中,選擇類型、方法或字段的名稱。您也可以僅僅在名稱中單擊一次。?
執(zhí)行下列其中一項(xiàng)操作:?
1.從菜單欄中,選擇瀏覽 打開聲明?
2.從編輯器的彈出菜單中,選擇打開聲明?
3.按 F3 鍵,如下圖