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]
3 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]3 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
Select the best option that should be considered when preparing these images to.be used for the web
DerKrebs [107]
The answer is 1) JPEG  2) TIFF   3) BMP.  
<span>The best option that should be considered when preparing these images to.be used for the web :
</span>1) JPG (jpeg) - Used to compress web images to a small file size without
    sacrificing quality
2) TIFF (tiff) - Used for professional print images to save in a uncompressed 
     file format at high resolution.
3) BMP - Used for either web or print because of the ability to save high
    quality images ether compressed or uncompressed.
6 0
3 years ago
How many total numbers can be represented with an 8-bit binary (base-2) system?
ddd [48]

Answer:

256

Explanation:

4 0
3 years ago
Write any four causes of cyber crime
jenyasd209 [6]
A Lack of Empathy
The Victim Deserves It
Self-loathing
It Becomes an Addiction
7 0
3 years ago
____________improves the understandability of a website, by maintaining similar design elements throughout.
lora16 [44]

Simple and easy user interface design can help the users understand what they can do on the website, without confusion when they are loading on the website.

Best practice on the users experiences can help the users to visit the website easily and get what they want as fast as possible. It is the way to improve a website understandability.

4 0
3 years ago
Suppose that the following elements are added in the specified order to an empty binary search tree: Lisa, Bart, Marge, Homer, M
Alecsey [184]

Answer:

Pre-order: Lisa, Bart, Homer, Flanders, Marge, Maggie, Smithers, Milhouse

In-order: Bart, Flanders, Homer, Lisa, Maggie, Marge, Milhouse, Smithers

Post-order: Flanders, Homer, Bart, Maggie, Milhouse, Smithers, Marge, Lisa

Explanation:

The required orders are mentioned.

4 0
3 years ago
Other questions:
  • when you cross or enter traffic from a full stop, how much space should you allow on city streets? on the highway?
    11·1 answer
  • a ____ consists of wires connecting the cpu and other parts of the computer. The _____ transfers data between CPU and memory uni
    6·1 answer
  • What happens if you move unencrypted files into an encrypted folder?
    5·1 answer
  • If you are inserting an address block with the Address Block dialog box and the fields do not connect automatically, what can yo
    6·2 answers
  • A noisy signal has been uploaded to D2L in the files fft_signal.mat and fft_signal.txt.Write a program to estimate the power spe
    10·1 answer
  • Networking and telecommunications technologies, along with computer hardware, software, datamanagement technology, and the peopl
    11·1 answer
  • Plz subscribe my yt gaming channel <br>FIREAZZ GAMING​
    8·2 answers
  • 1. How many bits would you need to address a 2M × 32 memory if:
    8·1 answer
  • Why are computers better than humans at solving a problem like finding the shortest route between ten different cities?
    15·2 answers
  • Edge is a video game featuring interactive extreme sports. The graphics used in the game are protected by
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!