皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
阅读以下说明和Java源程序,将应填入(n)处的字句写在答题纸的对应栏内。 说明 以下程序的功能是计算三角形、矩形和正方形的面积并输出。 5个类组成:AreaTest是主类,类Triangle、Rectangle和Square分别表示三角形、矩形和正方形,抽象类Figure提供了一个计算面积的抽象方法。 程序 public class AreaTest{ public static void main(String args[]){ Figure[]figures={ new Triangle(2,3,3),new Rectangle(5,8), new Square(5) }; for(int i=0;i<figures.1ength;i++){ System.out.println(figures[i]+'area='+figures[i].getArea()); } } } public abstract class Figure{ public abstract double SetAJea(); public class Rectangle extends (1) { double height; double width; public Rectangle(double height,double width){ this.height=height; this.width=width; } public String toString(){ return 'Rectangle:height='+height+',width='+width+':'; } public double getArea() { return (2); } } public class Square extends (3) { public Square(double width) { (4); } public String toString() { return 'Square:width='+width+':'; } } public class Triangle extends (5). { double la; double lb; double lc; public Triangle(double la,double lb,double lc) { this.la=la; this.lb=lb; this.lc=lc; public String toString(){ return 'Triangle: sides='+la+','+lb+','+lc+':'; public double getArea() { double s=(la+lb+lc)/2.0; return Math.sqrt(s*(s-la)*(s-lb)*(s?1c)); } }
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【简答题】对一个创业项目进行商机评估时主要评估( )等方面。
【单选题】认为发展的实质是新事物的产生和旧事物的灭亡的观点是( )
A.
形而上学唯物主义观点
B.
辩证唯物主义观点
C.
相对主义观点
D.
唯心主义观点
【简答题】生活中蕴科学,留心处皆学问。请用下列序号填空。 ①Na 2 CO 3 ②盐酸③酒精④牛奶⑤甲醛⑥熟石灰 (1)富含蛋白质的物质是_________; (2)常用于浸制生物标本的是_________; (3)常用于除铁锈的是_________; (4)可用作清洁燃料的是__________; (5)侯氏联合制碱法的主要产品__________; (6)可改良酸性土壤的是___________。
【单选题】The Unadjusted Trial Balance columns of a company's work sheet show the balance in the Office Supplies account as $750. The Adjustments columns show that $425 of these supplies were used during the pe...
A.
$325 debit.
B.
$325 credit.
C.
$425 debit.
D.
$750 debit.
E.
$750 credit.
【单选题】请问牛奶中主要的蛋白质是()。
A.
酪蛋白
B.
乳清蛋白
C.
乳白蛋白
D.
球蛋白
【单选题】After closing entries are posted, the balance in the Owner's Capital account in the ledger will be equal to
A.
the beginning Owner's Capital reported on the statement of owner's equity.
B.
the amount of the Owner's Capital reported on the balance sheet.
C.
zero.
D.
the profit (or loss) for the period.
【判断题】( )采用斜面低温法保藏母种,于4°C冰箱保藏的有效期一般为3~6个月。
A.
正确
B.
错误
【单选题】The Unadjusted Trial Balance columns of a company's work sheet show the balance in the Office Supplies account as $750. The Adjustments columns show that $425 of these supplies were used during the pe...
A.
$325 debit.
B.
$325 credit.
C.
$750 debit.
D.
$750 credit.
【多选题】本案的食物中毒报告内容应包括
A.
食用人数、中毒人数、死亡人数
B.
中毒病人临床资料分析,如年龄分布、性别分布、主要症状、体征、化验结果、治疗经过、病程及死亡率
C.
引起中毒的食品,中毒原因、中毒性质、食品加工烹调情况
D.
各种样品化验结果
E.
结论及今后的建议
【单选题】The balance in the owner's capital account of ABC Co. Ltd. at the beginning of the year was $65 000. During the year, the company earned revenue of $430 000 and incurred expenses of $360 000, the owne...
A.
$20 000 and $95 000
B.
$70 000 and $95 000
C.
$70 000 and $85 000
D.
$60 000 and $75 000
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题