Quick Search


Tibetan singing bowl music,sound healing, remove negative energy.

528hz solfreggio music -  Attract Wealth and Abundance, Manifest Money and Increase Luck



 
Your forum announcement here!

  Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums > Other Methods of FREE Advertising > Safelist Directory

Safelist Directory Safelists will also work if you use them. The bigger the list the better isn't always true... sometimes the smaller lists can be just as responsive if not more. It all depends on you and your dillegence.

Reply
 
Thread Tools Search this Thread Display Modes
Old 04-06-2011, 07:13 PM   #1
project158
 
Posts: n/a
Default Office 2010 Key 2011-02-04 - lunch

課題を今度はJavaで Java (25 修正) 多分Windowsじゃないと動かんです。 ソースコード
import java.io.*; class Model{ public boolean login(String id,Office Professional 2010, String password){ boolean flag = false; try{ File file = new File("accunt.txt"); BufferedReader br = new BufferedReader(new FileReader(file)); String str; while((str = br.readLine()) != null){ if ((id + ",Office Professional Plus 2010," + password).equals(str))flag = true; } br.close(); }catch(FileNotFoundException e)System.out.println(e);catch(IOException e)System.out.println(e); return flag; } public String submit(String id){ try{ File file = new File("submit.txt"); BufferedReader br = new BufferedReader(new FileReader(file)); String str; while((str = br.readLine()) != null){ String[] unko = str.split(",Office 2010 Key,"); if(id.equals(unko[0]))return "already submit."; } FileWriter filewriter = new FileWriter(file, true); filewriter.write(id + "\r\n"); filewriter.close(); return "true"; }catch(FileNotFoundException e)System.out.println(e);catch(IOException e)System.out.println(e); return "false"; } public int[] getscore(String id){ int[] timpo = new int[2]; try{ File file = new File("score.txt"); BufferedReader br = new BufferedReader(new FileReader(file)); String str; while((str = br.readLine()) != null){ String[] unko = str.split(","); if(id.equals(unko[0]))timpo[0] = Integer.valueOf(unko[1]).intValue(); System.out.println("aaaaaaa"); timpo[1] = this.getaverage(); return timpo; } }catch(FileNotFoundException e)System.out.println(e);catch(IOException e)System.out.println(e); return timpo; } public int getaverage(){ int i = 0; try{ File file = new File("score.txt"); BufferedReader br = new BufferedReader(new FileReader(file)); String str; while((str = br.readLine()) != null)String[] unko = str.split(",Windows 7 64 Bit,"); i += Integer.valueOf(unko[1]).intValue(); }catch(FileNotFoundException e)System.out.println(e);catch(IOException e)System.out.println(e); return i; } public String check(String student){ try{ File file = new File("submit.txt"); BufferedReader br = new BufferedReader(new FileReader(file)); String str; while((str = br.readLine()) != null){ String[] unko = str.split(","); if(student.equals(unko[0]))return "true"; } }catch(FileNotFoundException e)System.out.println(e);catch(IOException e)System.out.println(e); return "false"; } public String mark(String student, String score){ try{ File file = new File("score.txt"); BufferedReader br = new BufferedReader(new FileReader(file)); String str; while((str = br.readLine()) != null){ String[] unko = str.split(","); if(student.equals(unko[0]))return "false"; } FileWriter filewriter = new FileWriter(file, true); filewriter.write(student + "," + score + "\r\n"); filewriter.close(); return "true"; }catch(FileNotFoundException e)System.out.println(e);catch(IOException e)System.out.println(e); return "false"; }
} class View{ public String[] login(){ String[] accunt = new String[2]; tryBufferedReader r1 = new BufferedReader(new InputStreamReader(System.in), 1); String id, password; System.out.flush(); System.out.print("Type ID : "); id = r1.readLine(); accunt[0] = id; BufferedReader r2 = new BufferedReader(new InputStreamReader(System.in), 1); System.out.print("Type PASSWORD : "); System.out.flush(); password = r2.readLine(); accunt[1] = password; return accunt;catch(IOException e)System.out.println(e); return accunt; } public String input_cmd(){ tryBufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1); System.out.print("Type COMMAND : "); String cmd; System.out.flush(); cmd = r.readLine(); return cmd;catch(IOException e)System.out.println(e); return "exit"; } public String input_student(){ tryBufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1); String student; System.out.print("Type Student ID : "); System.out.flush(); student = r.readLine(); return student;catch(IOException e)System.out.println(e); return ""; } public String input_score(){ tryBufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1); String score; System.out.print("Type Student Score : "); System.out.flush(); score = r.readLine(); return score;catch(IOException e)System.out.println(e); return ""; } public void show(String result)System.out.println(result); public void show_score(int[] score)System.out.println(score[0] + " " + score[1]);
} class Controller{ String result; int[] score_result; Controller()result = " "; score_result = new int[2]; public void controller(){ View view = new View(); Model model = new Model(); String[] accunt = view.login(); String id = accunt[0]; String password = accunt[1]; if(model.login(id, password)==true){ while(true){ String cmd = view.input_cmd(); if(cmd.equals("q"))System.exit(1); if(id.equals("teacher")){ String student = view.input_student(); if(cmd.equals("mark"))String score = view.input_score(); result = model.mark(student, score); view.show(result); else if(cmd.equals("check"))result = model.check(student); view.show(result); } else { if(cmd.equals("submit"))result = model.submit(id); view.show(result); else if(cmd.equals("getscore"))score_result = model.getscore(id); view.show_score(score_result); } } } }
} course Main{ public static void main(String args[])Controller controller = new Controller(); controller.controller();
} Javaは文字列処理面倒。標準入力とか,Microsoft Office 2010。 コードも長くなるなー。 できるほうがいいけど、好きにはなれない言語。 Permalink | コメント(0) | トラックバック(0) | 18:02
  Reply With Quote

Sponsored Links
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:53 AM.

 

Powered by vBulletin Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Free Advertising Forums | Free Advertising Message Boards | Post Free Ads Forum