资源描述:
《c#基础练习题(国外英语资料)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、C#基础练习题DatatypepracticeproblemsWritethecharactersforunicodeencoding0x7EF0and0x8F9ErespectivelyOutput2.5423andtwodecimalformatsWrite23and-76originalandcomplementOperatorandexpressionpracticeproblems1lettheusertypeinthelengthandwidthoftherectangle,thenshowthec
2、ircumferenceoftherectangle2.Intxis6,yis6,p,q;Writethefollowingstatement,thevalueofx,y,andq(1)pisequaltox++++x++.(2)3.Useanintvariablesaidapersonamonthattendance,allowtheusertoinputthevalueofthevariable,andthenprompttheuserfor1~31onenumber,tojudgewhetherthepe
3、rson'sattendanceontheday.ConditionalstatementexercisesTakeanumberanddeterminewhetherthisnumberisaprimenumber(primenumber,alsoknownasaprimenumber:thenumberthatcanonlybedivisibleby1anditself,2isthesmallestprimenumber)Taketwointegers,comparethesize,andprintoutt
4、helargeNumbers.Toreceivetwointegersandasymbol(+-*/%),whichcorrespondstotwointegersbasedonthesymbol.Divideyourgradesintofourgrades:90-100-Alevel70-89-Blevel60-69-CgradeBelow60DReceivethestudent'sgradeandgetthegradeoftheparticipantTakethreeandprintoutthemaximu
5、mReceivethreeNumbersandrankthemfromsmalltolargeDetermineifanumbercanbedivisibleby3and5Thepriceofaticketwillvaryaccordingtotheshippingspaceandthemonthofthetrip.Asinthepeakseason5-October:firstclasspriceis10%offtheoriginalprice;Economyclassis75percentoftheorig
6、inalprice.Otheroff-seasontravel:firstclasspricesare60%offtheoriginalprice;Economyclassisa30%discountfortheoriginalprice.Dependingonthemonthofthetripandthetypeofcabinyouchoose,calculatethecorrespondingfares(ifandswitch,respectively)Theprincipaliscalculatedacc
7、ordingtotheprincipalandtheinterestrateoftheperiod.Interestratesareasfollows:1year2.25%2yearsof2.7%Threeyearsof3.24%Fiveyears3.6%Definethevariabletoholdtheprincipalandinterestrates,andcalculatethetotalamountofinterestinmaturity.Enteranumberfromthescreentodete
8、rmineifitis"daffodils".Theso-called"daffodilnumber"meansathree-digitnumber,itsdigitalcubeandthenumberitself.Forexample:153isa"daffodilnumber"because153=13+53+33Usetheswitchimplementation:enterad