Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Improve the program's functionality by utilizing at least 5 of the concepts from the list below. Document how the game works, including how you utilized each of the chosen concepts and what it's role is in the overall program.

List of Concepts

1. Vectors with iterators

2. Do or while loops

3. Operator overloading

4. Pointers/references

5. The heap(objects with 'new')

6. Destructor overloading

7. Constructor overloading

8. Copy constructor overloading

9. STL algorithms (sort, shuffle, etc..)

10. Private/protected data members/functions

11. Block scope

12. Function overloading

13. Multidimensional arrays

14. Functions, parameters, return values

// Guess my number

// The classic number guessing game

#include

#include

#include

using namespace std;

int main()

{

srand(static_cast(time(0))); //seed random number generator

int secretNumber = rand() % 100 + 1; // random number between 1 and 100

int tries = 0;

int guess;

cout << "\tWelcome to Guess My Number\n\n";

do

{

cout << "Enter a guess: ";

cin >> guess;

++tries;

if (guess > secretNumber)

{

cout << "Too high!\n\n";

}

else if (guess < secretNumber)

{

cout << "Too low!\n\n";

}

else

{

cout << "\nThat's it! You got it in " << tries << "guesses!\n";

}

} while (guess != secretNumber);

return 0;

}

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9901964

Have any Question?


Related Questions in Computer Engineering

What is the broadcast domain and ports for hubs and

What is the Broadcast Domain and Ports for hubs and bridges?

Answer the question given belowwhat is the relationship

Answer the question given below What is the relationship between a context diagram and diagram 0, and which symbol is not used in a context diagram? The response must be typed, single spaced, must be in times new roman f ...

A good sample of benzoic acid melts at 121-122 degrees

A good sample of benzoic acid melts at 121-122 degrees Celsius. However, a student had a sample that melted over a range, 105-115 degrees Celsius. What did the student conclude about that sample?

A recent study reported that the prevalence of

A recent study reported that the prevalence of hyperlipidemia is 30% in children 2 to 6 years of age. If 12 children are analyzed what is the probability that at least 3 are hyperlipidemic?

Under the trade model with external economies of scale is

Under the trade model with external economies of scale, is it possible for a country to be worse off with trade than it would have been without trade? Justify your answer.

Question suppose you are given a turing machine m not

Question : Suppose you are given a Turing machine M (not necessarily a decider), a string w, and a (different) magic genie. You can ask the magic genie whether a certain Turing machine accepts a certain input string, and ...

It is required to design an iterative combinational circuit

It is required to design an iterative combinational circuit that computes the equation Z=2*X-Y, where X and Y are n-bit unsigned numbers. (i) Determine the number of inputs and outputs needed for your 1-bit cell. (ii) De ...

Explain the differences between working in the web based

Explain the differences between working in the web based version of Outlook in Office 365 to the desktop application version of Outlook.

Is it okay too copy a fellow classmate programming code

Is it okay too copy a fellow classmate programming code when you are stuck? Will that break a school honesty policy? Please explain

If sailsboro just paid a dividend of 2 per share amp

If Sailsboro just paid a dividend of $2 per share & dividends are expected to grow at 8%, 6%, and 5% for the next three years respectively. After that the dividends are expected to grow at a constant rate of 3% indefinit ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As