while((str=bufferRead.readLine())!=null) { double totalScore=Fenxi.getTotalScore(str); str = str+\总成绩:\ System.out.println(str); bufferWrite.write(str); bufferWrite.newLine(); }
bufferRead.close(); bufferWrite.close(); }
catch(IOException e) {
System.out.println(e.toString()); } } }
Fenxi.java
import java.util.*; public class Fenxi {
public static double getTotalScore(String s) {
String regex=\匹配非数字的正则表达识 String digitMess=s.replaceAll(regex,\
StringTokenizer fenxi = new StringTokenizer(digitMess,\ double totalScore=0;
while(fenxi.hasMoreTokens()){
double score = Double.parseDouble(fenxi.nextToken()); totalScore = totalScore+score; }
return totalScore; } }
请补充完毕程序,并运行截图。40分,每空10分。
1. 2. 3. 4.
任务2 文件拷贝
请把一个图片文件在系统盘下进行复制 .60分