摘要: /*12.10(Shape层次)实现图11.3中的Shape 层次。忽略Triangle 类和Tetrahedron 类。每个TwoDimensionalShape应当包含只读抽象属性Area,它计算二维形体的面积。每个ThreeDimensionalShape应当包含只读属性Area和Volume 阅读全文
posted @ 2018-04-07 18:30 v123ve 阅读(328) 评论(0) 推荐(0)
摘要: /*10.5(储蓄账户类)创建一个SavingsAccount 类。,利用一个静态变量anaualInterestRate 来保存全部账户持有人的年利率。类的每一个对象都包含一个私有实例变量savingsBalance,表示该存款账户当前的存款余额。提供一个计算月利息的CalculateMonthl 阅读全文
posted @ 2018-04-07 18:30 v123ve 阅读(605) 评论(0) 推荐(0)
摘要: /*9.3(查询Invoice对象的数组)利用本章例子的ex_09_03文件夹下提供的Invoice类,创建一个Invoice对象的数组。自定义数量。Invoice类中包含4个属性:部件编号(PartNumber,int类型)、部件描述(PartDescription,string类型)、要购买的数 阅读全文
posted @ 2018-04-07 18:29 v123ve 阅读(251) 评论(0) 推荐(0)
摘要: /*10.3(矩形类)创建一个Rectangle 类。这个类具有属性lengh 和width,默认值都为1。e 还包含readonly 属性Perimeter( 周长)和Area( 面积)。应当通过set 方法验证length 和width都为大于0.0且小于20.0 的浮点数。编写一个程序,测试这 阅读全文
posted @ 2018-04-07 18:29 v123ve 阅读(314) 评论(0) 推荐(0)
摘要: 1.hold ? fish : palm; 鱼和熊掌不可兼得 2. if(this.Head.SetDirection(TheMoon.GetInstance().Position)) { this.Head.SetDirection(GROUND_DIRECTION); this.ThinkAbo 阅读全文
posted @ 2018-04-07 15:05 v123ve 阅读(1838) 评论(0) 推荐(0)
摘要: using System;class My{static void Main(){Pow r=new Pow (); System.Threading .Thread.Sleep (10000);}}class Pow{public Pow(){ Console.WriteLine("请输入你要求幂 阅读全文
posted @ 2018-04-07 15:02 v123ve 阅读(384) 评论(0) 推荐(0)
摘要: using System;class ChessBoard{ public char[,] SquareColor=new char [8,8]; public ChessBoard() { for(int i=0;i<SquareColor.GetLength (0);i++) { for(int 阅读全文
posted @ 2018-04-07 15:01 v123ve 阅读(216) 评论(0) 推荐(0)
摘要: using System;class UsingRecursive{ static void Main() { int intResult; string strResult; UsingRecursive myURec=new UsingRecursive (); intResult=myURec 阅读全文
posted @ 2018-04-07 15:00 v123ve 阅读(134) 评论(0) 推荐(0)
摘要: int a = Convert.ToInt32(Console.ReadLine()); int b = Convert.ToInt32(Console.ReadLine()); if (b>a) { int x = a; a = b; b = x; } while (a%b!=0) { int n 阅读全文
posted @ 2018-04-07 14:58 v123ve 阅读(161) 评论(0) 推荐(0)
摘要: using System;namespace luntan{ class Class1 { static void Main(string[] args) { int x=0; int[] Sum1=new int[1000]; for(int i=1;i<10;i++) { for(int j=1 阅读全文
posted @ 2018-04-07 14:57 v123ve 阅读(156) 评论(0) 推荐(0)