# Drawa structured flowchart , C++,  write pseudocode that describes the process of guessing a number between 1 and 100. After each guess, the player is told that the guess is too high or too low. The process continues until the player guesses the correct number. Pick a number and have a fellow student try to guess it following your instructions.

Question
Asked Feb 5, 2020
8 views
Drawa structured flowchart , C++,  write pseudocode that describes the process of guessing a number between 1 and 100. After each guess, the player is told that the guess is too high or too low. The process continues until the player guesses the correct number. Pick a number and have a fellow student try to guess it following your instructions.
check_circle

## Expert Answer

Step 1:Flowchart

A flowchart of guessing a number between “1” and “100” is as follows,

Step 2:Pseudocode

A pseudocode of guessing a number between “1” and “100” is as follows,

START

num1<-Generate random number between “1” and “100”

Get num2

while num2!=num1

if num2>num1 then

print “Your guess is too high”

else

print “Your guess is too low”

endif

Get num2

endwhile

print “You are correct”

STOP

Step 3:Program

A C++ program for the given criteria is as follows,

File name: "main.cpp"

#include <iostream>

#include<cstdlib>

using namespace std;

int main()

{

int num1,num2;

num1= (rand() % 100) + 1;

cout<<"Guess a number"<<endl;

cin>>num2;

while(num2!=num1)

{

if(num2>num1)

{

cout<<"Your guess is too high"<<endl;

cout<<"Guess another numer"<<endl;

cin>>num2;

}

else

{

cout<<"Your guess is too low"<<endl;

cout<<"Guess another numer"<<endl;

cin>>num2;

&n...

### Want to see the full answer?

See Solution

#### Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

### Computer Engineering

© 2020 bartleby. All Rights Reserved.