c++-大神请进,帮小孩看一下他的算法,点评点评。

问题描述

大神请进,帮小孩看一下他的算法,点评点评。

问题如下:

算法如下:

Algorithm for the programming assignment #2

Algorithm for the game of absorb material

Step1: Welcome the user and explain the purpose of how to use this program to play

Step1a: Display a heading (“absorbing material game”)

Step2: Get the name of players

  ---(step2a)Prompt the user

    “Please input the name of the first player”

  ---Enter the name of first player (player[0])

  ---Read it in the data and store in a char variable

  ---Echo the name of the first player (display it)

    “The first player’s name” amount the variable

  ---Ask the user if the name was correct (Y/N)

  ---If not, re-prompt and read until the user player is happy (repeat step 2a)

  ---(step 2b)Prompt the user again

    “Please input the name of the second player”

  ---Enter the name of second player (player[1])

  ---Read it in the data and store in a char variable

  ---Echo the name of the second player (display it)

    “The second player’s name”amount the variable

  ---Ask the user if the name was correct(Y/N)

  ---If not, re-prompt and read until the user player is happy (repeat step 2b)

Step3: Distribute the points

  ---(step 3a)Prompt the first user

    “Please input the points of the game! (10 points)”

  ---Enter the number of the points ( int a)

  ---Read it in the data and store it in a int variable

  ---Echo the number of the points (display it)

    “The number of the points at the before beginning the game”amount the variable

  ---Ask the user if the points meet with the requirement of the game(Y/N)

  ---If not, re-prompt and read until meet with the requirement (repeat step 3a)

  ---(step 3b)Prompt the second user

    “Please input the points of the game! (10 points)”

  ---Enter the number of the points (int b)

  ---Read it in the data and store it in a int variable

  ---Echo the number of the points (display it)

    “The number of the points at the before beginning the game”amount the variable

  ---Ask the user if the points meet with the requirement of the game(Y/N)

  ---If not, re-prompt and read until meet with the requirement (repeat step 3b)

Step4: Enter the question

  ---(step 4a)Prompt the first player

    “Please input the question on the screen”

  ---Enter the question (char question[])

  ---Count the number of words of the question and store it in a int variable (int c)

  ---Read it in the data and store it in a char variable

  ---Echo the question (display it)

    “The question is” among the variable

  ---Ask the first player if the question is correct(Y/N)

  ---If not, re-prompt and read until the user is happy (repeat step 4a)

Step5: Clear the question

  ---Prompt the second player

    “Don’t see the problem when the first player enter the question”

  ---Display the question and disappear quickly( type the enter key)

Step6: Show the question for the second player

  ---Prompt the second player

    “Are you ready to see the question and you have only three seconds to see (Y/N)”

  ---Enter the answer (char ch1)

  ---If the answer is Y (y)

  ---Read it in the data and store it in a char variable

  ---Echo the answer (display it)

    “Your answer is”among the variable

  ---If yes, then do the next step

  ---Echo the time left (display it)

    “Time-left:”among the positive number

Step7: Memory the question

  ---Prompt the second player

    “You have five seconds to recall the question”

  ---Echo the time left (display it)

    “Time-left:”among the positive number

Step8: Try to relax

  ---Prompt the second player

    “Relax yourself before answering the question”

Step9: Is ready for the second player

  ---(step 9a)Prompt the second player

    “Are you ready to answer the question? (Y/N)”

  ---Enter the answer (char ch2)

  ---Read it in the data and store it in a char variable

  ---Echo the answer (display it)
    “Your answer is”among the variable

  ---Ask the second player if the answer is correct(Y/N)

  ---If not, re-prompt and read until the meet with the second player’s requirement

    (repeat step 9a)

  ---If the second player answer is no

  ---Read it in the data and store it in a char variable

  ---(step 9b)Prompt the second player

    “This time you have 30 seconds to see this question and remember it, but your

     Points will deducted” (points=points-1)

  ---Read the points in the data and store it in a integer variable

  ---Show the question on the screen

  ---Echo the time left (display it)

    “Time-left:”among the positive number

  ---Prompt the second player

    “You have ten seconds to recall the answer”

  ---Echo the time left (display it)

    “Time-left:” among the positive number

  ---Prompt the second player

    “Relax yourself before typing the question”

Step10: Begin to type the question

  ---Prompt the second player

    “Begin to type the question”

  ---Enter the question (char question1[])

  ---Count the number of words of the question1 and store it in a int variable (int d)

  ---Read it in the data and store it in a char variable

Step11: Compare the number of words

  ---(step 11a)If the number of words in the same and the word(Y/N)

  ---If yes, then do the next step

  ---Echo a sentence (display it)

    “You do a great job! And you can add one point to your points” (points=points+1)”

  ---Read it in the data and store it

  ---If no, then do the next step

  ---Echo a sentence (display it)

    “Your point need to deducted by one point” (points=points-1)

  ---Read it in the data and store it

Step12: Switch turns

  ---Prompt the player

    “The position of the player changes”

  ---Repeat the step from step 4 to step12 until one player has no point

Step13: Game over

  ---Prompt the player

    “Who don’t have points?”

  ---If the first player don’t have points

  ---Echo a sentence (display it)

    “The second player win the game”

  ---If the second player don’t have points

  ---Echo a sentence (display it)

    “The first player win the game”

Step14: Re-play the game

  ---Prompt the player

    “Do you want to play again? (Y/N)”

  ---If yes, then repeat the step from step2 to step13

  ---If no, then exit the game

Step15: Thank you for using this program to play

解决方案

建议你去外语学院问,这个和编程没关系了。

解决方案二:

没必要这样

解决方案三:

一句点评,您孩子外语真不错,流程图理解得挺好,关键是有礼貌。

RSVP(Rapid Serial Visual Presentation) Game Developing:
STEP 1
Step1: Welcome the user and explain the purpose of how to use this program to play
Step1a: Display a heading (“absorbing material game”)
Step2: Get the name of players
 and more ...
Step3: Distribute the points
 and more ...
Step4: Enter the question
 and more ...
Step5: Clear the question
 and more ...
Step6: Show the question for the second player
 and more ...
Step7: Memory the question
 and more ...
Step8: Try to relax
 and more ...
Step9: Is ready for the second player
 and more ...
Step10: Begin to type the question
 and more ...
Step11: Compare the number of words
 and more ...
Step12: Switch turns
 and more ...
Step13: Game over
 and more ...
Step14: Re-play the game
 and more ...
Step15: Thank you for using this program to play

解决方案四:

我好累。 不认识。肿么办

解决方案五:

还是英语的啊

建议把流程图画出来

解决方案六:

字典翻的好累!真心不认识它们!

时间: 2024-09-17 03:48:01

c++-大神请进,帮小孩看一下他的算法,点评点评。的相关文章

collection-大神请进,帮忙看下这个Collection的排序。

问题描述 大神请进,帮忙看下这个Collection的排序. package com.jeffge; import java.util.*; public class StringSorting { public static void main(String[] args) { ArrayList persons = new ArrayList(); persons.add(new Person("Sam", 25)); persons.add(new Person("Sa

eclipse-Eclipse常用技巧,Android大神请进!

问题描述 Eclipse常用技巧,Android大神请进! Eclipse中我用类名申明了一个对象,然后类中用到了这个类对象,怎么从这个类对象进入到那个类中啊,我看到别人双击一下怎么就进去了,求大神帮我,谢谢! 解决方案 你将光标移动到这个类实例上,然后按ctrl+鼠标左键点击,或者是shift,你自己试试 如果回答对您有帮助,请采纳 解决方案二: 按住ctrl,然后鼠标点击 解决方案三: ctrl+双击 亲 网上搜一下 eclipse 快捷键大全 上面全有 如果点不进去就是找不到 那个类了 你

求翻校内的墙,大神请进

问题描述 求翻校内的墙,大神请进 我所在的公司设置了网络墙,只能上规定的几个网站,其余的如知乎,豆瓣, 天涯之类的网站上不去,求破解. 解决方案 vpn搞起,豆荚加速器 解决方案二: vpn呀,翻墙神器,连不能看的网站都能上 解决方案三: http://bbs.liebao.cn/forum.php?mod=viewthread&tid=255579 解决方案四: 推荐蓝盾,可以翻墙,赛风可以修改VPN,都可以 解决方案五: 你可以使用VPN呀,这样什么网站都能上了 解决方案六: 下载green

游戏-关于Mecanim动画的 unity3d大神请进

问题描述 关于Mecanim动画的 unity3d大神请进 这两天在看mecanim动画 我在一个项目里做了两个人物模型 一个添加了mecanim一个没有 就是一个有骨骼动画 一个没有,然后弄成两个prefab之后BuildAssetBundle,在另外一个项目里动态加载进去.通过实验可以用,但是我发现了个问题就是BuildAssetBundle之后有动作的比没动作的资源大了不少.我想用个方法来保留一份动作资源,比如在导入的项目里保留一个Animator Controller,在脚本里动态地给A

反爬虫-菜鸟求助,大神请进:python爬取某东评论数据遇到的问题

问题描述 菜鸟求助,大神请进:python爬取某东评论数据遇到的问题 python爬取京东评论数据,爬10页的评论没问题,后面的评论就不断重复,到底是什么原因? 解决方案 先看是不是服务器返回的内容 然后就是你请求的参数有问题 所有重复请求 解决方案二: 应该是url没去重吧 解决方案三: 最近看到一个csdn的博客专门讲如何写电商爬虫的,地址是:http://blog.csdn.net/youmumzcs/article/details/51373830,楼主可以参考

java写服务器端安卓写服务器端,两者如何进行对接,大神请进....

问题描述 java写服务器端安卓写服务器端,两者如何进行对接,大神请进.... 大神都会点开这个帖子的,所以我就开门见山了 1. java写服务器端如何返回手机安卓用户端能接受的数据形式? 2. 如何处理手机端返回的数据 3. 如何对接起来 解决方案 一切都是json,后台返回json前台解析 解决方案二: 用socket写的吗? 解决方案三: 我们公司统统用json来回传递

编程-大神们能帮我看下这个C里就多了这几行没多大关系的代码,就引发了异常断点?

问题描述 大神们能帮我看下这个C里就多了这几行没多大关系的代码,就引发了异常断点? 在第一张图里上一个cEx2数组输出正常,然后就经过了imper2的内存分配和赋值,不应该造成下面在cEx2[1]输出时引发的断点啊! 求解神们?查了一下午仍然没结果,只能求神了-- 解决方案 已解决,编译器问题好像.只要把malloc放到开头,就不会有这个问题. 求解释?表示不懂. 解决方案二: 多余了就把它删除了吧,可能是和你前面的代码发生冲突了-- 解决方案三: 希望能把问题描述清楚,这样大家才好帮你定位问题

c语言 mfc win32-都说csdn大神多,我想问问C++的模块问题,大神请进

问题描述 都说csdn大神多,我想问问C++的模块问题,大神请进 def文件是这样写的: LIBRARY hookdll EXPORTS SetHook @2 SEGMENTS MySec READ WRITE SHARED 想各路大神能否解释一下这几个单词的意思?这是C++模块.def的.刚学到钩子,视频讲的不明白,望一解 解决方案 库文件名字 导出函数 名字 序号 数据段 读写共享设置

图标设计-大神请进,关于图标制作的问题

问题描述 大神请进,关于图标制作的问题 在百度搜了许久,没有得到答案,我就是想知道像qq这样的超大精致图标到底怎么制作,有会的吗? 解决方案 这个应该是 PS 高手设计的吧,专业的设计软件 解决方案二: 绘图软件 用不着ps