java问题,请大大帮忙,急
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)));
谢谢大大
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
顶一下
老大能不能先帮我一下
这好像是什么考试题……
是啊,赶着用!