Dont know HOW TO DO A PSEUDOCODE REALLY REALLY NEED HELP ON THS QUESTION!

Imagine a computer randomly selects a card from a pack of cards. You have to guess what card it is. You have to guess the suit first then its value. After each guess for the suit a message will be displayed to indicate whether your guess was successful or not. Simarly every guess for the value of suit will generate a message indicating whether the value is correct, too low or too high.

The game ends when you have correctly identified the card selected by the computer.

At the completion of playing 5 games the average number of guesses to correctly identify a card for that named individual will also be displayed together with an invitation to play the game again.

I really need a simple pseudocode of this solution

Please could someone help if they have any idea how to do this!

Recommended Answers

All 8 Replies

Pseudocode is half-code, half-english. Basically, it is the algorithm that you use to solve the task at hand, without worrying about the intricate language syntax.

For more information, read the article here: http://www.daniweb.com/tutorials/tutorial1731.html and all of the comments that follow it.

Here is how to find the solution ...

Read the question.
Decide what the question is asking for.
What is needed to solve the problem?
What is the input? What is the output?
How is the problem going to be solved?
Is there a formula? What is the formula?

Answer all of those questions ... put them all together ... and you have pseudocode.

Imagine something like:

. . . 
set Suit = random value 1..4
set Card = random value 1..13 // ace, 2..10, j, q, k
set input-suit to 0
while Suit != input-suit
    ask for suit as input-suit

expand that to the whole problem and *poof* ... pseudocode.

Remember that the purpose of pseudocode is to give more detail than an English description of the problem, but not to write actual compilable code (i.e. you could take the pseudocode and code it an any of several languages).

You can gloss over syntactic details of a given language, but you should not gloss over the process you intend to follow; like don't assume variables would be initialized - write pseudocde to do it.

From the pseudocode, someone who knows nothing of the English description should be able to write code to do what was asked.

Dont know HOW TO DO A PSEUDOCODE REALLY REALLY NEED HELP ON THS QUESTION!

Imagine a computer randomly selects a card from a pack of cards. You have to guess what card it is. You have to guess the suit first then its value. After each guess for the suit a message will be displayed to indicate whether your guess was successful or not. Simarly every guess for the value of suit will generate a message indicating whether the value is correct, too low or too high.

The game ends when you have correctly identified the card selected by the computer.

At the completion of playing 5 games the average number of guesses to correctly identify a card for that named individual will also be displayed together with an invitation to play the game again.

I really need a simple pseudocode of this solution

Please could someone help if they have any idea how to do this!

Haha, i remember this class. It was in my AP Programming class in high school using borland C++. Then again i could never really understand why we used pseudocode, i personally hated it...

Open device 1, human_memory
Open device 2, pencil_and_paper
indent_level = 0
Repeat
Get 1, next_task
code_line$ = Convert_to_code (next-task)
Call Hungarian (code_line$, indent_level, indent_string$) by reference
Print 2, indent_string$, code_line$
Until EOF(1)
Close All
Exit

please give some examples of pseudocoding ..i really really need it !!

commented: Nope -1

I need Help writing in pseudocode...please

A program is to be developed that will calculate the total length of music to be stored on a CD. Assume a CD may store 76 minutes of music. The user will enter the length of musical tracks in minutes and seconds (separately) in a loop. A loop will be used to prevent the user from entering a negative value for the minutes value; and a loop will be used to force the user to enters a seconds value in the range of 0 to 59 inclusive. The length of each track will be added to the sum of minutes and seconds that are stored on the CD. If the number of seconds, when summed, exceeds 59, add one to the minutes value and adjust the seconds accordingly.

After the length of each track is entered, the user will be asked if they wish to enter another track. If the user responds with no, then the sum of the time will be displayed. If the user answers yes, then another track will be entered only if the current sum is less than 76 minutes. If the current sum exceeds 76 minutes, track input will end, and the total sum will be displayed. After the total sum of the time is displayed, the program will end.

Did you not read the help offered above?

Pseudo code is just a narrative step by step procedures in solving a problem. You just have to analyse the problem(what the problem wants), then list all the steps required.
But remember, pseudo code is not a computer program but it takes some elements from computer programs.

example: Display question;
Set count to zero;
accept response;
if response=YES or count>20 then halt

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.