首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > (1) 设计一个程序,用于根据用户输入的命令行参数数量来计算长方形、正方形、三角形的面积。如果输入的参数为一个、二个、三个则它们应分别对应正方形、长方形、三角形...

(1) 设计一个程序,用于根据用户输入的命令行参数数量来计算长方形、正方形、三角形的面积。如果输入的参数为一个、二个、三个则它们应分别对应正方形、长方形、三角形...

资 源 简 介

(1) 设计一个程序,用于根据用户输入的命令行参数数量来计算长方形、正方形、三角形的面积。如果输入的参数为一个、二个、三个则它们应分别对应正方形、长方形、三角形,如果没有参数,则通过异常处理方法现实错误消息。(用于计算面积的方法是一个重载的方法。提示:定义一个抽象的父类,并提供一个抽象的方法area(). 再派生出三个子类,重写area()方法,然后在main方法中用多态来实现具体的面积函数的调用)。-(1) design a program based on user input for the command line parameters to calculate the number of rectangular, square, triangle area. If the input parameter is one, two, three then they should correspond to a square, rectangle, triangle, without parameters, exception handling through the real error message. (Used to calculate the area is an overloaded method. Note: the definition of an abstract parent class, and provides an abstract method area (). To send birth to three sub-classes override area () method, and then in main method using multi-state to achieve a specific area of a function call).

文 件 列 表

Count
.classpath
.project
area.class
count.class
count.java
MyException1.class
MyException2.class
Rectangle.class
Square.class
Triangle.class
VIP VIP
0.184688s