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
Hey good to mett you
ella [17]

Answer:

You too?

Explanation:

4 0
3 years ago
"The _____ of the Open Systems Interconnection (OSI) model generates the receiver’s address and ensures the integrity of message
aleksklad [387]

Answer:

The transport layer

Explanation: Layer 4, is the transport layer of the Open System Interconnection (OSI), that handles message transfer of data between end systems or hosts and ensures complete packets transfer.

7 0
3 years ago
Read 2 more answers
Production cost can be reduced using technology. Explain
Black_prince [1.1K]

Explanation:

By reducing the time the use on unnecessary tasks. And you would be able to operate on using your time on beneficial tasks

3 0
3 years ago
What should you do if the drive on which you want to install windows server 2012 already has a partition on it containing an ope
Alinara [238K]
Delete those partitions and reformat the drive.
4 0
3 years ago
Meats ages hair and feathers all contain this monomer
OverLord2011 [107]

Answer:Amino Acid

Explanation:

All proteins have amino acids

7 0
2 years ago
Other questions:
  • Plz answer these questions...those who give answer get the brainliest......hurry up..!!!​
    14·1 answer
  • Jane is debugging a code consisting of 25 lines. The code starts executing at line 11. At line 13, the code calls another method
    10·2 answers
  • Create a stored procedure sp_Q1 that takes two country names like 'Japan' or 'USA'as two inputs and returns two independent sets
    10·1 answer
  • "Which of the following is not an example of a project? Select one: a. Creating a website for a company b. Raising money for a d
    5·1 answer
  • . Explain and demonstrate the functionality of timer devices in an embedded system[
    9·1 answer
  • Is there any quantum computer in India?​
    9·1 answer
  • Haley is responsible for checking the web server utilization. Which things should she review while checking the server utilizati
    8·2 answers
  • Five plus six is equal to?​
    10·2 answers
  • Write a pseudocode that receives a positive number from the user, and then,
    14·1 answer
  • Kate saves her work on a secondary storage device that is fairly new, and uses flash technology instead of disks.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!