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
An information system is the set of steps that needs to be followed to ensure that software development proceeds in an orderly f
tia_tia [17]

Answer:

True

Explanation:

It is TRUE that An Information System is the set of steps that need to be followed to ensure that software development proceeds in an orderly fashion.

This is evident in the fact that the Information system involves various stages and different elements such as data, people, procedures, hardware, and software.

All these elements form together to create several steps in software development in a suitable manner that meets the clients' and customers' needs.

4 0
3 years ago
How to resize an image in photoshop without losing quality.
castortr0y [4]

Answer:

Explanation:

Make sure resample is turned on

Turn on the chain link if you want the width and height to change together. If not, turn off the chain so that you can set your own width and height.

Choose your new size (you can choose to choose different measurement units by clicking on “inches”)

press ok

i hoped this helped!!!!!!!!

8 0
2 years ago
What is the main goal of computer generated by digitalization
mars1129 [50]

Answer:

for better future and attractive human life

4 0
3 years ago
Given the char * variables name1, name2, and name3, write a fragment of code that assigns the largest value to the variable max
Assoli18 [71]

Answer:

The following code as follows:

Code:

max=name1;   //define variable max that holds name1 variable value.

if (strcmp(name2, max)>0)  //if block.

{

   max=name2;  //assign value to max.

}

if (strcmp(name3,max)>0)   //if block.

{

  max=name3; //assign value to max.

}

Explanation:

In the above code, we define a variable that is max. The data type of max variable is the same as variables "name1, name2, and name3" that is "char". In the max variable, we assign the value of the name1 variable and use if block statement two times. In if block, we use strcmp() function that can be defined as:

  • In first if block we pass two variables in strcmp() function that is "name2 and max" that compare string value. If the name2 variable is greater then max variable value so, the max variable value is change by name2 variable that is "max=name2".
  • In second if block we pass two variables in strcmp() function that is "name3 and max" that compare string value. If the name3 variable is greater then max variable value so, the max variable value is change by name3 variable that is "max=name3".

4 0
3 years ago
What types of storage can be used to access your data on a another computer
vladimir1956 [14]
1. Cloud Storage, such as dropbox or Google drive,
2. Network attached storage, where all your data is stored on a central NAS, and you can access it in Windows explorer or Mac Finder
3 Data on flash drive or on an external hard drive.
3 0
3 years ago
Other questions:
  • Lance has three tables in his database he wants to generate a report to show the data from the three table so he decides to link
    6·2 answers
  • AYUDAAA..... DARÉ TODOS LOS PUNTOS QUE PUEDA.
    15·1 answer
  • Which method deletes a footer from a document?
    9·2 answers
  • Which of the following represent emerging classes of application software? Check all of the boxes that apply.
    9·3 answers
  • Drive-by hacking is a computer attack where an attacker accesses a wireless computer network, intercepts data, uses network serv
    5·1 answer
  • A project manager is responsible for (check all that apply)
    13·1 answer
  • According to the video, some workers who work for themselves, such as Actors, Musicians, or Writers, may have what sort of worke
    7·1 answer
  • Which of the following browsers was introduced with windows 10?
    10·1 answer
  • In the RSA system, the receiver does as follows:1. Randomly select two large prime numbers p and q, which always must bekept sec
    6·1 answer
  • Write a program that reads a file called 'test.txt' and prints out the contents on the screen after removing all spaces and newl
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!