分类：电脑/网络-程序设计
问题：菜鸟求助帮帮忙 
帮帮忙
回答：告诉我用什么语言来写的。。。。。。。============================================实在抱歉,这两天没及时帮你把程序写出来.刚才花了点时间写了一下.不过我还是提醒你一下,这个程序只给你做个参考,学习是循序渐进的事情,一定要塌塌实实的学.usingSystem;usingSystem.Collections.Generic;usingSystem.Text;namespaceConsoleApplication2{classProgram{staticvoidMain(string[]args){//创建一个对象Bookbook=newBook();//属性赋值book.BookNo="123456";book.BookName="C#";book.BookPrice=59.9M;//打印图书信息book.ShowBookInfo();//价格范围比较decimaldstPrice=50;boolret=book.PriceRange(book.BookPrice,dstPrice);if(ret){Console.WriteLine("图书价格大于"+Convert.ToDecimal(dstPrice)+"$");}else{Console.WriteLine("图书价格小于"+Convert.ToDecimal(dstPrice)+"$");}Console.WriteLine("________________这是一条分割线___________________");//创建两个矩形对象Rectanglereg1=newRectangle(2.0,3.0);Rectanglereg2=newRectangle(4.0,5.0);doublearea1=reg1.Area();doublearea2=reg2.Area();doublerange1=reg1.Range();doublerange2=reg2.Range();stringstrArea=area1>area2?"大于":"小于";stringstrRange=range1>range2?"大于":"小于";Console.WriteLine("矩形1的面积为"+area1.ToString());Console.WriteLine("矩形1的周长为"+range1.ToString());Console.WriteLine("矩形2的面积为"+area2.ToString());Console.WriteLine("矩形2的周长为"+range2.ToString());Console.WriteLine("矩形1的面积"+strArea+"矩形2的面积");Console.WriteLine("矩形1的周长"+strRange+"矩形2的周长");Console.WriteLine("________________这是一条分割线___________________");//创建一个模帐号为Mark,余额为50万的对象,先后经过存款10万,取款20万后,显示余额。Accountaccount=newAccount("Mark",500000);if(account.Deposit(100000)){Console.WriteLine("成功存入100000");}else{Console.WriteLine("存款操作失败");}if(account.Etch(200000)){Console.WriteLine("成功取出200000");}else{Console.WriteLine("取款操作失败");}account.ShowBalance();//暂停Console.Read();}}classBook{privatestring_BookNo;//编号privatestring_BookName;//书名privatedecimal_BookPrice;//价格publicstringBookNo{get{return_BookNo;}set{_BookNo=value;}}publicstringBookName{get{return_BookName;}set{_BookName=value;}}publicdecimalBookPrice{get{return_BookPrice;}set{_BookPrice=value;}}publicvoidShowBookInfo(){Console.WriteLine("图书编号:"+BookNo);Console.WriteLine("图书名:"+BookName);Console.WriteLine("图书价格:"+BookPrice+"$");}publicboolPriceRange(decimalsrcPrice,decimaldstPrice){if(srcPrice<0||dstPrice<0){returnfalse;}returnsrcPrice>dstPrice? }}classRectangle{//定义属性privatedoubleLength;privatedoubleWidth;//构造函数publicRectangle(doubleLength,doubleWidth){this.Length=Length;this.Width=Width;}//求面积publicdoubleArea(){if(Length<0||Width<0){return0;}returnLength*Width;}//求周长publicdoubleRange(){if(Length<0||Width<0){return0;}return2*(Length+Width);}}classAccount{privatestringAccountID;privatedecimalAccountBalance;publicAccount(stringAccountID,decimalAccountBalance){this.AccountID=AccountID;this.AccountBalance=AccountBalance;}//存款publicboolDeposit(decimalAddMoney){if(AddMoney<=0){returnfalse;}this.AccountBalance+=AddMoney;returntrue;}//取款publicboolEtch(decimalSubMoney){if(SubMoney<=0||SubMoney>AccountBalance){returnfalse;}this.AccountBalance-=SubMoney;returntrue;}publicvoidShowBalance(){Console.WriteLine("余额为:"+AccountBalance.ToString());}}}