A program for estimating a randomly generated number
in the range of 0-99 will be designed.When the user enters a
number, the program will direct the "enter a larger / smaller
number" to ensure that the produced count is found. warning will be
given when the number produced by the computer is found. how many
steps I have answered will be shown in the sample program output
below. design the c ++ program that performs these operations
Translation of the sample given in the picture:
enter the number you guessed: 40
enter a larger number
Repetition of the top two samples
Repetition of the top two samples
Repetition of the top two samples
Repetition of the top two samples
Repetition of the top two samples
Repetition of the top two samples
Repetition of the top two samples
Translation of the sample given in the picture:
enter the number you guessed: 71
congrulations!!!
you found the number 71 produced by the computer in 8 steps

CODE
#include<iostream>
#include <stdlib.h>//for rand() and srand()
#include <ctime>//for time()
using namespace std;
int main()
{
srand(time(0));
int rn=rand()%100;//to generate random number
int gn=101;//We will store our guessed number here
//taking such a number which won't satisfy in first time
int cnt=0;//To count number of moves
cout<<"Lets Start the Guessing Game"<<endl;
cout<<"You have to guess the number between 0 - 99"<<endl;
while(rn!=gn)
{
cout<<"Enter the number you have guessed : ";
cin>>gn;
cnt++;
if(rn>gn)
{
cout<<"Enter a greater number."<<endl;
}
else if(rn<gn)
{
cout<<"Enter a smaller number."<<endl;
}
else
{
cout<<endl<<"Congratulations...!!"<<endl;
cout<<"You found the number "<<rn<<" produced by the computer in "<<cnt<<" steps"<<endl;
}
}
return 0;
}
Screenshots

You might think why I used srand(time(0)) the reason I because rand() function has an algorithm, meaning there are steps that can be repeated to obtain a certain result so its outcome will always be the same. You change this by using a "seed" a good "seed" in this case is time() since it is always changing. So time(0) will return the current time.
Hope you like my answer? .
A program for estimating a randomly generated number in the range of 0-99 will be designed.When...
2) compute contribution margin for each channel
3) compute break even point (in terms of number of orders and
dollars) for each distribution channel
(HINT - Fixed costs are all trade show expenses. Use
depreciation for the booth as a fixed cost. The booth cost should
be considered an investment not a fixed cost)
4) Calculate the number of orders at a target profit of
$100,000
5) Calculate the profitability for both the low and high order
estimates
We were...
I need help to write a nice introduction for experiment 6
please ( no hands write ) typing
Thank you
HEAT TREATMENT OF STEELS EXPERIMENT 6 EXPERIMENT 6 HEAT TREATMENT OF STEELS THEORY The Effect of Cooling Rate One of the most convenient methods for controlling the properties of a given steel, i.e., a steel whose composition is already fixed, consists of austenizing the steel and ten cooling to room temperature at some predetermined rate. A variation of cooling rates...