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 > Manual Traffic Exchanges

Manual Traffic Exchanges This is a list of Manual traffic exchanges that you can use to get your site viewed by thousands of people a week. Manual traffic exchanges are better known for quality over the quantity you find with auto surfs. But both are great for generating traffic.

Reply
 
Thread Tools Search this Thread Display Modes
Old 03-25-2011, 10:48 AM   #1
buisness5119
Lieutenant General
 
Join Date: Mar 2011
Posts: 1,217
buisness5119 is on a distinguished road
Default Office Ultimate 2007 2011-02-04 - lunch

課題を今度はJavaで Java (25 修正) 多分Windowsじゃないと動かんです。 ソースコード
import java.io.*; course Model{ public boolean login(String id, 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()) ,Office Ultimate 2007!= null){ if ((id + "," + 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()) ,Windows 7 Professional!= null){ String[] unko = str.split(","); if(id.equals(unko[0]))return "already submit."; } FileWriter filewriter = new FileWriter(file,Windows 7 Home Basic Key, 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(","); 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"; }
} course 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]);
} course 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,Office 2007 Ultimate, 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は文字列処理面倒。標準入力とか。 コードも長くなるなー,Windows 7 X86。 できるほうがいいけど、好きにはなれない言語。 Permalink | コメント(0) | トラックバック(0) | 18:02
buisness5119 is offline   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 06:46 PM.

 

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