资源描述:
《c#第一次上机实验(国外英语资料)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、C#第一次上机实验PracticealanguagebasicpracticeOne,thepurposeoftheexperimentFamiliarwiththeVisualStido.NETlabenvironment;Masterthewritingmethodoftheconsoleprogram;Masteringthesyntaxofc#programminglanguages;Mastertheuseofcontrolstatements.Second,theexperimentalrequirementWritethec#programasrequir
2、ed,andwritetheprogramcodeandtherunningresultstothelabreport.Third,experimentalcontentWriteaconsoleapplication,typeinatriangleorrectangle,andcalculateitscircumferenceandareaandoutput.Thesourcecode:UsingSystem;UsingSystem.Collections.Generic;UsingSystem.Linq;UsingSystem.TheText;Thenamespac
3、eText1{ClassProgram{StaticvoidMain(string[]args){While(true){System.TheConsole.WriteLine("pleasechoose?Choose?Sequence¨°?:eo1.Areypartyproblem?Shape?2.Three?¨yAngleshape?LoseDHS?¨?0junction¨¢beamDHS?!E?");IntI;()Theswitch(I){Case1:Intm,n,Cirs,Sqarea;System.TheConsole.WriteLine("DHSplease
4、?Lose?¨??AsideA?Long?¨edegrees¨:eo");(1)theSystem.().readline());System.TheConsole.Write("wide¨a:eo");()Cirs=2*(m+n);Sqarea=m*n;System.TheConsole.WriteLine("Iispartyproblem?Yshape??Weeks¨createsalong?eisa:eo{0}",Cirs);A:theareaoftheunitisa:eo{0},theSqarea.Break;Case2:Doubles,t,x,p,Cirt,T
5、riarea;System.TheConsole.WriteLine("DHSplease?Lose?¨??AsideA?Long?¨edegrees¨:eo");System.TheConsole.Write("the¨IsquaredA°?Such?As?A:eo");S=inint.parse().System.TheConsole.Write("the¨Isquaredarticle2tdeal?Side?A:eo");T=in.parse().System.TheConsole.Write("the¨Isquaredthree¨yrope?Side?A:eo"
6、);()Cirt=s+t+x;Pisequaltosplustplusxover2.TheTriarea=math.sqrt(p-s)*(p-x)).System.TheConsole.WriteLine("three¨yAngle??I?¨zhoucreatesalong?eisa:eo{0}",Cirt);System.TheConsole.WriteLine("Ithree¨yAngle????Productyisa:eo{0}",Triarea);Break;Default:Thereturn;}}}}}Theresults:Writeaconsoleappli
7、cationthatdeterminestheseasonbasedonthemonthyouenter.Thesourcecode:UsingSystem;UsingSystem.Collections.Generic;UsingSystem.Linq;UsingSystem.TheText;ThenamespaceText2{ClassProgram{StaticvoidMain(string[]args){While(true){IntI;System.TheConsole.WriteLine("DHSplease?Lose?Int