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.
1 answer:
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
Answer:
You too?
Explanation:
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.
Explanation:
By reducing the time the use on unnecessary tasks. And you would be able to operate on using your time on beneficial tasks
Delete those partitions and reformat the drive.
Answer:Amino Acid
Explanation:
All proteins have amino acids