Document how the game works

Assignment Help Basic Computer Science
Reference no: EM13308425

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 inthe 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 <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand(static_cast<unsigned int>(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;
}

Reference no: EM13308425

Questions Cloud

Generate a histogram for all the grades : Generate a histogram for all the grades. Each score represents one dot on the histogram.
What is the boiling point of water at an elevation of 2000m : the boiling point of water decreases wiht elevation because of the pressure change. what is the boiling point of water at an elevation of 2000m and at an elevation 4000 m for standard atmospheric conditions
Explain the connection between i, s : 1) If the desired level of investment spending (I) is greater than the level of national savings (S), are net exports (NX) positive, negative, or zero? Explain the connection between I, S, and NX (in words as well as mathematically).
What torque does friction exert : A 720 gram grinding wheel 30.0cm in diameter is in the shape of a uniform solid disk. What torque does friction exert while this wheel is slowing down
Document how the game works : 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 inthe overall program.
Explain what advantages does mpls offer : Conduct research on traffic engineering using MPLS. List a set of goals for traffic engineering. Which of these goals can only be met with MPLS, and which are met by using existing (non-MPLS) protocols. What advantages does MPLS offer
Ocial enterprises in global supply chains or in new busines : The research question(s) for the study may depend on the student's interest in social business, in social enterprises
Determine what should the size of the gap at b be : The bar AB has an axial rigidity of EA. The bar is rigidly attached at A while there is a gap at B. A load P acts at point C and has a large enough magnitude to close the gap at B.
Use eulers method : Use Euler's Method with (a) h=.5, (b) h=.25, and (c) h=.05 to solve dy/dx=yx^3-2.3y over the interval from x=0 to 2, where y(0)=1.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explain local telephone calls-long distance telephone calls

Will distinction between local telephone calls and long distance telephone calls ever disappear? What may cause this to happen?

  Find one article on computer or information technology

Find one article on computer or information technology

  Determines the change to be dispensed from a vending machine

Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and a dollar, in 5-cent increments(25,30,35,..90,95,100), and the machine accepts only a single dollar to pay for t..

  Government regulation in bio-engineered products

When it comes to the food industry and the bio-engineered products, is there such a thing as too much government regulation?

  Action of violation of principle of least common mechanism

Discuss how this technique might prevent legitimate users from accessing the system. Why is this action a violation of the principle of least common mechanism?

  How do we make jar files

How do we make Jar files? What is a Jar file? How do we control what is in them? How do we make a Jar file executable?

  Instruction cycle and finding contents of registers

Go over instruction cycle and find out contents of registers PC, AR, DR, AC, and IR for each of seven memory-reference instructions.

  Social networking website to get information about applicant

Some companies are beginning to use social networking websites like Facebook and MySpace, to get information about job applicants.

  Draw a level 0 data flow diagram

Once the glasses have been made, you return to the store for a fitting and pay for glasses. The payment information is recorder in the order. You can use any tool to draw the diagram.

  Determine features of ram to include in web server

Determine the features and capacities (RAM, disk storage, processor speed) that Amy should include in the Web server computer that she will need for her site.

  What is the probability of rolling the outcome snake eyes

What is the probability of rolling the outcome "snake eyes" (two ones) with these loaded dice? (c) What is the expected value of our random variable X with respect to this unfair distribution?

  A web-based registration and cashiering system

You work for a large public university that utilizes a web-based registration and cashiering system that allows students to register for, pay for, and drop classes

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd