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
Audra recently earned her associate’s degree and is looking for a job. Her resume lists her strengths in a separate section. Som
zhuklara [117]

With Audra’s associate degree and list of qualifications, she will be looking for an entry-level position. The position that would be most suitable for her would be (D) auditing clerk.

She will not quality for an Accountant and Marketing Manager position, which requires a longer amount of experience as well as a higher degree of education, and she is overqualified for the Data Entry position which does not require her level of qualifications.

8 0
3 years ago
Read 2 more answers
You are trying to access the Wi-Fi network at a coffee shop. What protocol will this type of wireless networking most likely use
Anna71 [15]

The wireless network is called WAP protocol

8 0
3 years ago
Carlos had 194 seeds and 11 flower pots he put the same number of seeds in each flower pot which is the best estimate for the nu
Anon25 [30]

Answer: in solution.

Explanation:

It is basically 194 divided by 11 since we are evenly grouping 194 seeds into 11 pots. This gives 17.636363…

This means that the best estimate is around that number.

6 0
2 years ago
A personal computer uses a number of chips mounted on a circuit board called microprocessor. system board. daughter board. mothe
AveGali [126]
I am almost 100% sure that it is called a microprocessor 
8 0
3 years ago
Sandy has an entry-level position in a graphic design company. She wants to learn more about the company and the skills she shou
Yakvenalex [24]
The answer should have been B, what was the answer?
8 0
3 years ago
Read 2 more answers
Other questions:
  • Integrated circuits are made up of _____ that carry the electrical current.
    14·1 answer
  • A short-circuit evaluation is where each part of an expression is evaluated only as far as necessary to determine whether the en
    14·1 answer
  • What is a Photojournalist
    5·1 answer
  • I stole you pokemon cards :o
    6·2 answers
  • The
    6·2 answers
  • What will be displayed if the following Java code segment is run? System.out.println("one "); System.out.print("two "); System.o
    12·1 answer
  • Which of the following data structures can erase from its beginning or its end in O(1) time?
    10·1 answer
  • What layer of the OSI model describes how data between applications is synced and recovered if messages don't arrive intact at t
    12·1 answer
  • Consider the following code.
    7·2 answers
  • List four tasks that humans perform frequently, but which may be difficult for a computerized agent to accomplish. Describe the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!