1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alinara [238K]
2 years ago
14

Write a program that allows the user to play a guessing game. The game will choose a "secret number", a positive integer less th

an 10000. The user has 10 tries to guess the number.
Computers and Technology
1 answer:
Burka [1]2 years ago
8 0

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

// Program starts here

#include<iostream.h>

#include<stdlib.h>

int main()

{

// Declare variables

int num, selectno;

string status;

randomize();

//Generate random number;

num=rand()%10000;

// Prompt to guess a number

cout<<"You have only 10 tries\nTake a guess: ";

int tries = 0;

while (tries != 10)

{

cin>>selectno;

if(selectno == num){

cout<<"You passed at the "<<count+1<<" attempt";

tries = 10;

}

else

{

cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";

}

tries++;

if(tries >= 10)

{

break;

}

}

return 0;

}

You might be interested in
How many of you got the right answer from this app​
Flura [38]
Actually, a lot, and it’s especially helpful when the answer is expert verified
8 0
2 years ago
Which shortcut keys can be used to duplicate a slide?
Leya [2.2K]

Answer:

Ctrl + D used to duplicate a slide

8 0
2 years ago
How do you stop your questions on here from getting your questions from getting removed?
Amanda [17]

you don't........................

7 0
3 years ago
Read 2 more answers
in your own ideas what are the disadvantages of participating in a videoconference write your answer inside the circle​
ipn [44]
Some disadvantages of taking part in a video-conference are:

1) Lack of communication from social cues (social cues are what we use to see if someone is in a good or bad mood)

2) There is a high chance of unstable network connection.

3) Technical and personal issues because not everyone is comfortable speaking on a video-conference platform.

4) It causes more stress due to the lack of organization when preparing meetings (because it’s so easy to just get on a device without preparing anything beforehand).

Hope this helped!
5 0
2 years ago
Call 334-399-4201 to annoyed my mom
yaroslaw [1]

Answer: why...

Explanation:

3 0
3 years ago
Other questions:
  • If you want to copy text formatting from one area of your document to another area, _____.
    5·2 answers
  • What uses HTML hypertext links that users can click to access different locations or information?
    11·1 answer
  • Samantha was calculating a mathematical formula on an electronic spreadsheet. She used multiple values to recalculate the formul
    8·2 answers
  • As the operations manager for a supermarket chain, Mai needs to find a telecommunications technology that: enables managers in r
    9·1 answer
  • is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources th
    9·1 answer
  • What do you do to add a line or circle to your presentation?
    7·2 answers
  • The exponential distribution is often used to model what in a queuing system?
    12·1 answer
  • You might have trouble interpreting a message if:
    15·1 answer
  • What will be the results from running the following code?
    5·1 answer
  • PLEASE HELP!!!!! WILL MARK BEST ANSWER BRAINLIEST!!!~~~
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!