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
2 Manter o autocontrole nos ajuda a evitar muitos problemas na nossa vida pessoal e no ambiente profissional. Em se tratando de
Umnica [9.8K]

Answer:

english please

Explanation:

8 0
3 years ago
Explain ,how the computer network reduces cost of operation? (don't copy from any website)​
melomori [17]

Answer:

Computer network reduces the operation cost as it allows to share software and hardware in the network.

4 0
3 years ago
14 Copy a picture of a crane on the next page. Do not trace them. Make a freehand sketch. (2) 2 Look at the placed where the Mar
PtichkaEL [24]

Answer:

Hope it helps.have a look.

3 0
2 years ago
____ is one of the primary operations of a computer.
Romashka [77]
Processing <span>is one of the primary operations of a computer.</span>
7 0
3 years ago
________________is a distribution of Linux Operating<br>system for desktop computers.<br>​
Ket [755]

Answer:

Ubuntu

Explanation:

Ubuntu is based on Linux and Debian and is free/open-source. It’s released in 3 editions: Desktop, Core, and Server.

Hope this helped!

3 0
3 years ago
Other questions:
  • AYUDAAA..... DARÉ TODOS LOS PUNTOS QUE PUEDA.
    15·1 answer
  • Software design and implementation are interleaved activities. The level of detail in the design depends on the type of system b
    5·1 answer
  • How many buttons does a gamecube controller have?
    7·1 answer
  • What does Data storage enable a browser to do
    5·1 answer
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels
    11·1 answer
  • You are creating a presentation and you have come to the last slide. you still have more information to add. what should you do?
    10·2 answers
  • what program searches the Internet for specified keywords and returns a list of the pages where the keywords were found
    6·1 answer
  • Hi I need help with an assignment. We're learning about encryption and decryption in code.org. i need help with three of the tex
    14·1 answer
  • The method used to transfer information to far off place instantly is called​
    13·2 answers
  • What technology does kroger’s edge technology and amazon’s just walk out technology leverage?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!