subject

In this warm up project, you are asked to write a c++ program proj1.cpp that lets the user or the computer play a guessing game. the computer randomly picks a number in between 1 and 100, and then for each guess the user or computer makes, the computer informs the user whether the guess was too high or too low. the program should start a new guessing game when the correct number is selected to end this run (see the sample run below).

check this example and see how to use functions time() and rand() to generate the random number by computer.

example of generating and using random numbers:

#include
#include // srand and rand functions
#include // time function
using namespace std;

int main()
{
const int c = 10;

int x;
srand(unsigned(time(; // set different seeds to make sure each run of this program will generate different random numbers
x = ( rand() % c);
cout < < x < < endl;
x = ( rand() % c ); // generate a random integer between 0 and c-1
cout < < x < < endl;
return 0;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
How will you cite information that is common knowledge in your research paper?
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
You know the right answer?
In this warm up project, you are asked to write a c++ program proj1.cpp that lets the user or the co...
Questions
question
Biology, 25.10.2021 01:20
question
Advanced Placement (AP), 25.10.2021 01:20
question
Geography, 25.10.2021 01:20
question
Biology, 25.10.2021 01:20
question
Social Studies, 25.10.2021 01:20
question
Biology, 25.10.2021 01:20
question
Mathematics, 25.10.2021 01:20
question
Mathematics, 25.10.2021 01:20
Questions on the website: 13722362