免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1698 | 回复: 3
打印 上一主题 下一主题

java问题,请大大帮忙,急 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-04-22 06:21 |只看该作者 |倒序浏览
Question 1

Write a class My Triangle that implements the mutiple interfaces Translatable, and Scalable provided below. The class encapsulates 3 points from the mutuable class Mpoint. Do not provide any of the inquiry or mutator methods. Note that a triangle is translatable by a given distance dx and dy by adding them to the x and y coordinates of all of its 3 points respectively. Also, a triangle is scalable by a factor s by multiplying the x and y coordinates of all of its 3 points by s.
Public interface Translatable
{public void translate (double dx, double by);}
public interface Scalable
{public void scale(double s);}

Question 2

Write a complete program (without the import statements) that takes from the command line the names of an input and an output text files. The program reads from the input text file a line at a time (until the end of the file), and writes only the lines starting with the letter ‘T’. Use the char At () method to extract the first character of the line that was read. Use the Buffered Reader and Print Writer classes. They can be opened as follows:

BufferedReader inFile = new Buffered Rader (new File Reader (input File Name));
PrintWriter outFile=new PrintWriter (new Buffered Writer (new File Writer (outputFile Name)));
谢谢大大

论坛徽章:
0
2 [报告]
发表于 2003-04-22 06:29 |只看该作者

java问题,请大大帮忙,急

顶一下

老大能不能先帮我一下

论坛徽章:
0
3 [报告]
发表于 2003-04-22 09:14 |只看该作者

java问题,请大大帮忙,急

这好像是什么考试题……

论坛徽章:
0
4 [报告]
发表于 2003-04-22 09:35 |只看该作者

java问题,请大大帮忙,急

是啊,赶着用!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP