资源描述:
《java课程设计纸牌游戏》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
一、问题分析和任务定义1.题目:纸牌游戏:编号为1-52张牌,正面向上,从第2张开始,以2为基数,是2的倍数的牌翻一次,直到最后一张牌;然后,从第3张开始,以3为基数,是3的倍数的牌翻一次,直到最后一张牌;然后…从第4张开始,以4为基数,是4的倍数的牌翻一次,直到最后一张牌;。。。再依次5的倍数的牌翻一次,6的,7的直到以52为基数的翻过,输出:这时正面向上的牌有哪些?2.要求和任务:①该题目的要求如下:(1)将52张牌编号。(2)从2开始,依次作为基数对基数的倍数的牌进行翻转,直到以52为基数的翻转。(3)最后输出正面向上的牌。②基本任务为:(1)按照要求翻转纸牌。(2)输出最后正面向上的纸牌的编号。3.原始数据的输入及输出格式:原始数据要求输入纸牌的基础编号,编号的输入为整型。输出的是经过规律翻转后正面向上的纸牌的编号。输入的数据信息如下:纸牌:1、2、3……、51、52。问题直观分析表:123456789101112……12√√√√√√3√√√√4√√√5√√6√√7√8√9√10√11√12√…………(注:图中“√”表示翻转一次。)二.数据结构的选择和概要设计1.数据结构tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe 按照题目要求,整个主体包括一个嵌套的循环,外循环控制从2开始每张纸牌都作为基数进行翻牌,内循环控制对所有纸牌进行判断,如果是当前循环中基数的倍数,则对其进行翻转操作。具体代码如下:for(i=2;i<=52;i++){for(j=1;j<=52;j++){if(j%i==0)data[j-1]=data[j-1]*Flag;}}2.概要设计按照题目的要求,首先,应对52张牌进行编号并且保存它们的编号信息,编号的类型为整型,而对于这样固定的数据,使用整型数组是最好的,因此,我们需要在程序的开始定义一共整型的数组,同时,为了方便对翻转过程的记录,在定义记录编号信息的同时,定义一个与之相对应的标记数组,数组类型为整型。该程序的核心为一个嵌套的循环,所以定义两个变量i,j作为循环条件。接着开始对变量进行初始化,首先是编号信息数组,使用for循环对数组进行1到52的赋值,代表52张纸牌,然后对标记数组赋值,将数组内的所有的值初始化为零,方便在接下来的循环中统计每张牌的翻牌数。数据初始化结束后,开始按照要求对纸牌进行翻转,在嵌套循环中,定义了一个全局变量Flag,值为-1,负数定义为向下,正数定义为向上,这样,翻转一次,即乘以Flag,同时,符合翻转条件时,标记数组相应的编号的纸牌翻牌次数+1。循环结束后,编号数组中的数据已经更新,因此对数组进行扫描,大于零的即为正面向上的纸牌,输出其编号即可,同时,输出标记数组中的值,显示每张牌的翻牌记录,方便观察或者寻找规律。到此,整个题目结束。三.详细设计和编码1.定义全局变量:作为判断纸牌是否向上的依据,我们需要定义一个全局变量Flag=-1,在循环中对所有纸牌进行操作。2.主要程序代码与分析如下:staticintFlag=-1(考虑到最后要判断哪些纸牌是正面向上的,所以必须要有一共判断条件,因此定义一个全局变量作为正反面的判断条件。)publicstaticvoidmain(String[]args){inti,j,choice,num;//建立两个数组,一个存放52张牌的编号,另外一个存放相应编号的纸牌的翻牌记录。int[]data=newint[52];int[]flag=newint[52];Stringn,m;System.out.println("温馨提示:欢迎进入纸牌游戏程序!");tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe for(i=1;i<=52;i++){data[i-1]=i;//录入52张牌的编号。flag[i-1]=0;//将相应编号纸牌的翻牌数初始化为0。}for(i=2;i<=52;i++)//外循环,基数循环。{for(j=1;j<=52;j++)//内循环,基数倍数条件判断。{if(j%i==0){data[j-1]=data[j-1]*Flag;//将翻转后的结果更新data中的数据。flag[j-1]++;//翻牌一次,即记入flag数组中。}}}System.out.printf("t最后所有正面向上的牌有: ");for(i=0;i<52;i++){if(data[i]>0)//所有大于0的数即为正面向上的纸牌。System.out.printf("第%d张牌",i+1);}System.out.printf(" ");以上为程序主要代码的分析。在程序中,主要还包括功能界面,如下:System.out.printf("t----------------------------------------------------- ");System.out.printf("t----------------------------------------------------- ");System.out.printf("t-------欢迎进入纸牌游戏-------- ");System.out.printf("t-------1.查看题目-------- ");System.out.printf("t-------2.查看所有纸牌的翻牌次数-------- ");System.out.printf("t-------3.查看指定编号纸牌翻牌记录-------- ");System.out.printf("t-------4.查看最终正面向上的纸牌编号-------- ");System.out.printf("t-------5.制作人信息-------- ");System.out.printf("t-------0.按0键结束-------- ");System.out.printf("t----------------------------------------------------- ");System.out.printf("t----------------------------------------------------- ");同时,整个功能实现由do-while语句和switch语句组合而成,do-while语句可以保证界面最少运行一次,switch语句保证每个功能独立实现,通过choice的输入来进入不同的功能,同时在每个小的独立功能内,我都添加了独立判断是否回到主菜单的语句,如下:System.out.printf("是否回到主菜单?(Y/N):");n=sc.next();if(n.equals("Y"))break;elseif(n.equals("N"))choice=0;elseSystem.out.printf("*******(提示:输入错误,默认为继续。)******** ")tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe 整个do-while语句的结束条件为:choice=0,所以如果用户输入为N,则直接将0赋值给choice,则符合循环结束的条件,则直接结束程序,如果输入为Y,则break,继续循环,输入错误,没有对choice任何的赋值操作,即不能满足结束条件,则无论输入什么都默认为继续,break后继续循环。由于程序默认的将回车操作通过getchar()赋值给n,导致不能正常的实现下面的判断,而直接显示为输入错误,所以加入两个n=getchar()语句,保证第二句能够正确的实现功能,让用户自行输入条件,进行下一步的操作。在整个程序中,存在着大量的输入判断条件,如下:if(num<1&&num>52)System.out.printf("t输入错误! ");这两句代码就是对输入的num值进行判断,由于纸牌序号为1-52,所以不在这个范围的值都为错误值,需要有一个错误信息的反馈,所以需要对输入的信息进行判断,然后通过不同的值对数据进行相应的操作,这对于程序的正确运行,有着至关重要的作用。四.上机调试过程:该程序任务相对比较简单,思路较明确。在一开始编写代码的时候,在嵌套循环中,外循环for的条件(i=2;i<=52;i++),写成(i=1;i<=52;i++),导致对每个纸牌的翻转都多判断了一次,按照一开始定义的大于零的编号数为正面向上的条件,最后输出的结果正好相反,经过修改调试后,问题解决。在每个case中加入独立的判断是否回到主菜单的语句,一开始getchar()总是不能正确录入,没有输入就直接运行下一个语句,在加入控制语句后经过调试发现,程序把上一个输入的回车直接默认赋值给getchar(),导致没有输入,直接进行下一个语句,后来使用了两个连续的getchar()语句,第一个getchar()语句默认为回车,但是后面一个getchar()语句可以正确的重新输入判断值,经过重新的调试,运行正常,问题解决,但是希望能找到更完善的答案。在判断是否继续输入纸牌编码的功能中,同样遇到了这个问题,按照相同的解决办法解决。整个程序由一个大的do-while语句和switch语句组合实现界面的不同功能,do-while语句通过choice=0作为结束的条件,在case3中,有一个小的do-while语句实现纸牌编号的重复输入,在整个程序中有很多信息的输入,需要根据输入的信息正确与否来反馈信息,否则会导致程序出错,所以在调试的过程中加入了很多判断条件,可以解决信息输入错误的情况,但是仍然存在输入非整型值程序出错的问题,所以在输入条件中加入提示信息,以保证信息类型输入正确。五.测试结果及其分析1.测试结果如下图1-12;2结果分析以注释的形式写在图的下方;tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe (图2)(注:纸牌游戏程序的主功能界面。)(图3)(注:纸牌游戏程序功能1:查看题目。)tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe (图4)(注:纸牌游戏程序功能2:查看所有纸牌的翻牌次数。)tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe (图4续1)tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe (图5)(注:纸牌游戏程序功能3:查看指定编号纸牌翻牌记录。)(图8)(注:纸牌游戏程序功能4:查看最终正面向上的纸牌编号。)tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe (图10)(注:纸牌游戏程序结束画面。)tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe 附录:程序源代码:packageCartgame;importjava.util.Scanner;publicclassMain{privatestaticScannersc=newScanner(System.in);staticintFlag=-1;//定义一个全局变量作为正反面的判断条件。publicstaticvoidmain(String[]args){inti,j,choice,num;//建立两个数组,一个存放52张牌的编号,另外一个存放相应编号的纸牌的翻牌记录。int[]data=newint[52];int[]flag=newint[52];Stringn,m;System.out.println("温馨提示:欢迎进入纸牌游戏程序!");for(i=1;i<=52;i++){data[i-1]=i;//录入52张牌的编号。flag[i-1]=0;//将相应编号纸牌的翻牌数初始化为0。}for(i=2;i<=52;i++)//外循环,基数循环。{for(j=1;j<=52;j++)//内循环,基数倍数条件判断。{if(j%i==0){data[j-1]=data[j-1]*Flag;//将翻转后的结果更新data中的数据。flag[j-1]++;//翻牌一次,即记入flag数组中。}tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe }}do{System.out.printf("t----------------------------------------------------- ");System.out.printf("t----------------------------------------------------- ");System.out.printf("t-------欢迎进入纸牌游戏-------- ");System.out.printf("t-------1.查看题目-------- ");System.out.printf("t-------2.查看所有纸牌的翻牌次数-------- ");System.out.printf("t-------3.查看指定编号纸牌翻牌记录-------- ");System.out.printf("t-------4.查看最终正面向上的纸牌编号-------- ");System.out.printf("t-------5.制作人信息-------- ");System.out.printf("t-------0.按0键结束-------- ");System.out.printf("t----------------------------------------------------- ");System.out.printf("t----------------------------------------------------- ");System.out.printf("请输入您的选择(数字0-5):");//主界面choice=sc.nextInt();switch(choice)//通过switch语句进行功能的选择{case1:{System.out.printf("---题目--- ");System.out.printf("************************************************************** ");System.out.printf("编号为1-52张牌,正面向上,从第2张开始,以2为基数,是2的倍数的牌翻一次,");System.out.printf("直到最后一张牌;然后,从第3张开始,以3为基数,是3的倍数的牌翻一次,");System.out.printf("直到最后一张牌;直到以52为基数的翻过,输出:这时输出正面向上的牌有哪些? ");System.out.printf("****************************************************************");System.out.printf(" ");System.out.printf(" ");System.out.printf("是否回到主菜单?(Y/N):");//在每个独立功能后添加了独立的判断语句,从而可以选择性的回到主菜单。n=sc.next();if(n.equals("Y"))break;elseif(n.equals("N"))choice=0;//0作为整个界面的循环结束条件,所以直接将choice=0,即可结束循环。elsetofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe System.out.printf("**********(提示:输入错误,默认为继续。)*********** ");}break;case2:{System.out.printf("以下为翻牌记录: ");System.out.printf("t----第1张牌翻过0次。----t");System.out.printf(" ");System.out.printf(" ");for(i=1;i<52;i++){System.out.printf("t----第%d张牌翻过%d次。----t",i+1,flag[i]);if(i%2==0)System.out.printf(" ");}System.out.printf(" ");System.out.printf("是否回到主菜单?(Y/N):");n=sc.next();if(n.equals("Y"))break;elseif(n.equals("N"))choice=0;elseSystem.out.printf("**********(提示:输入错误,默认为继续。)************* ");}break;case3:{do{System.out.printf("t请输入您想查询的纸牌编码:");num=sc.nextInt();if(num<1&&num>52)//纸牌的序号为1-52,所以其他数值都为输入错误。System.out.printf("t输入错误! ");else{System.out.printf("t纸牌翻转记录如下: ");System.out.printf("t纸牌翻转次数为%d ",flag[num-1]);for(j=2;j<=52;j++)//内循环,基数倍数条件判断。{if(num%j==0){System.out.printf("t在以编号%d为基数时此纸牌有一次翻转。 ",j);}}}System.out.printf("需要继续查询纸牌编码吗?(Y/N):");//独立的判断语句,作为do-while的结束条件,从而可循环的查询纸牌编码。tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe m=sc.next();if(!m.equals("Y")&&!m.equals("N"))System.out.printf("************(提示:输入错误,默认为跳过。)********** ");}while(m.equals("Y"));System.out.printf("是否回到主菜单?(Y/N):");n=sc.next();if(n.equals("Y"))break;elseif(n.equals("N"))choice=0;elseSystem.out.printf("**************(提示:输入错误,默认为继续。)********** ");}break;case4:{System.out.printf("t最后所有正面向上的牌有: ");for(i=0;i<52;i++){if(data[i]>0)//所有大于0的数即为正面向上的纸牌。System.out.printf("第%d张牌",i+1);}System.out.printf(" ");System.out.printf("是否回到主菜单?(Y/N):");n=sc.next();if(n.equals("Y"))break;elseif(n.equals("N"))choice=0;elseSystem.out.printf("***************(提示:输入错误,默认为继续。)********** ");}break;case5:{System.out.printf("ttt制作人: ");System.out.printf("ttt班级: ");System.out.printf("ttt指导老师: ");System.out.printf("是否回到主菜单?(Y/N):");n=sc.next();if(n.equals("Y"))break;elseif(n.equals("N"))choice=0;elseSystem.out.printf("***************(提示:输入错误,默认为继续。)*********** ");}case0:break;default:System.out.printf("t输入错误,请重新输入! ");tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe }}while(choice!=0);//0作为整个循环的结束条件。System.out.printf("*******************程序结束,谢谢使用******************** ");}}重庆工商大学课程设计成绩评定表tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe 学院:计信学院班级:12计算机二学生姓名:杨浩学号:2012131206项目分值优秀(100>x≥90)良好(90>x≥80)中等(80>x≥70)及格(70>x≥60)不及格(x<60)评分参考标准参考标准参考标准参考标准参考标准学习态度15学习态度认真,科学作风严谨,严格保证设计时间并按任务书中规定的进度开展各项工作学习态度比较认真,科学作风良好,能按期圆满完成任务书规定的任务学习态度尚好,遵守组织纪律,基本保证设计时间,按期完成各项工作学习态度尚可,能遵守组织纪律,能按期完成任务学习马虎,纪律涣散,工作作风不严谨,不能保证设计时间和进度技术水平与实际能力25设计合理、理论分析与计算正确,实验数据准确,有很强的实际动手能力、经济分析能力和计算机应用能力,文献查阅能力强、引用合理、调查调研非常合理、可信设计合理、理论分析与计算正确,实验数据比较准确,有较强的实际动手能力、经济分析能力和计算机应用能力,文献引用、调查调研比较合理、可信设计合理,理论分析与计算基本正确,实验数据比较准确,有一定的实际动手能力,主要文献引用、调查调研比较可信设计基本合理,理论分析与计算无大错,实验数据无大错设计不合理,理论分析与计算有原则错误,实验数据不可靠,实际动手能力差,文献引用、调查调研有较大的问题创新10有重大改进或独特见解,有一定实用价值有较大改进或新颖的见解,实用性尚可有一定改进或新的见解有一定见解观念陈旧论文(计算书、图纸)撰写质量50结构严谨,逻辑性强,层次清晰,语言准确,文字流畅,完全符合规范化要求,书写工整或用计算机打印成文;图纸非常工整、清晰结构合理,符合逻辑,文章层次分明,语言准确,文字流畅,符合规范化要求,书写工整或用计算机打印成文;图纸工整、清晰结构合理,层次较为分明,文理通顺,基本达到规范化要求,书写比较工整;图纸比较工整、清晰结构基本合理,逻辑基本清楚,文字尚通顺,勉强达到规范化要求;图纸比较工整内容空泛,结构混乱,文字表达不清,错别字较多,达不到规范化要求;图纸不工整或不清晰指导教师评定成绩:指导教师签名:年月日tofindsolutions.Especiallyvaluableis,thesetwomissionstookthecityinBeijing,theconsiderableworkinblue,fromyinglaisongwang,provideservicestoinvitebusinessmenandformajorprojects,micromanaging,hands-on,realofficesfullservice,fullservicerole.HotelinPingliang,PingliangbuildingandprintingBrushfactoryservicequalityandservicelevelshavealsobeenfurtherenhanced.Second,creativelyworktowardsfundingprojectsontoanewstage.TheBeijingliaisonofficeLANfromsimplesecurefunding,andtheshifttoamoredirectlyinvolvedintheproject,fromthesmallprojectstolargeprojectstointroducechange,strengtheningprojectwork.LiaisonOfficeinBeijing,alwaysputthereportconvergenceandimplementation,asreportedtonationalconstructionprojects,Iworkatoppriority,taketheinitiativetostrengthencontactswithnationalministriesandprovincialauthoritiesoncontactand,fromtoptobottomconvergenceprojectsinadvance,timelyfeedbackonthecityandtheCounty(district).LiaisonOfficeinBeijingthisyear,andcooperatewith,ordirectlywithitem8oftheinterfaceimplementedonthenational,provincial,forStateinvestmentofnearly20millionYuan.TheblueOfficecloselyaroundthecity'sfourpillarindustries,largeprojectsandmorematureprojects,brandfocusanddirectionoftheprojectasaninvestment.Graspthe