java问题,请大大帮忙,急

发布于 2022-10-01 01:13:19 字数 1365 浏览 17 评论 0

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

眼泪也成诗 2022-10-08 01:13:19

顶一下

老大能不能先帮我一下

烏雲後面有陽光 2022-10-08 01:13:19

这好像是什么考试题……

紫南 2022-10-08 01:13:19

是啊,赶着用!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文