What it is role is in the overall program

Assignment Help Computer Engineering
Reference no: EM13322662

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 <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: EM13322662

Questions Cloud

What is the head loss due to friction per 1000 m of pipe : Water flows through a 250-mm diameter steel (C=120) pipe at a a velocity, V = 1.5 m/s. Using the Hazen-Williams equation, what is the head loss due to friction per 1000 m of pipe
What is the centerline uniform water depth in the channel : A 2-ft diameter circular pipe has a Manning's n of 0.013 and a bed slope of 2.0 X 10^-3. What is the uniform flow rate in this pipe if it is completely full (Qf) in ft^3/s
State what effect on the value of ca(oh)2''s ksp : What effect on the value of Ca(OH)2's Ksp (6.5x10^-6 ) would sucking up some suspended calcium hydroxide solid have. Would the Ksp value be higher or lower than the normal value. Why
Outline the major influences on business buyers : Outline the major influences on business buyers. Why is it important for the business-to-business buyer to understand these major influences?
What it is role is in the overall program : 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.
What is the laser beams electric field amplitude : A 150 MW laser pulse is focused with a lens to a diameter of 1.39 %u03BCm. What is the laser beam's electric field amplitude at the focal point
Determine the smallest allowable value of p of the tape : Knowing that the coefficents of friction between the tape and the drums are us=.40 and uk=0.30 and that drum C is free to rotate, determine the smallest allowable value of P if slipping of the tape on drum B is not to occur.
Any special ethical responsibilities : Do you think firms that market products for children have any special ethical responsibilities when they advertise? Why or why not? Give examples that support your position.
Determine amplification factor and magnitude of steady state : determine the amplification factor and the magnitude of steady state response (for deflection at A), when a horizontal force of 20Sin(8t) (N) is applied at B. (L= 250 mm, distance from center of mass to C = 40mm)

Reviews

Write a Review

Computer Engineering Questions & Answers

  Give differences between human centered and user centered

What are the differences between "human centered" and "user centered" approaches? Do you agree that human centered approach is more effective? Why or why not?

  Use the internet or computer magazines

utalize the Internet or computer magazines to investigate one of the following DBMSs: DB2, SQL Server, MySQL, Oracle, or Sybase.

  Rsa cryptosystem

Assume that we tried to simplify the RSA cryptosystem by making use of just a prime p in place of the composite modulus N = pq. As in RSA, we could have an encryption exponent e which is relatively prime to p − 1.

  What is the output of the statements

What is the output of the following statements. assume a and b are int variables.

  Figure out how to alter the pointers in the table

The table below gives portion of a linked list. Each list entry spans two consecutive address locations - first contains a letter of the alphabet, and second contains a pointer to the next list entry.

  Why recursion be considered a valuable technique

Why will recursion be considered a valuable technique.

  What is total capacity of a track

What is total capacity of a track

  Why this move to pcs bring new architecture

I can understand about the shift from old big mainframes to PCs that are becoming more and more powerful. But why not just link these PCs to the big mainframes and keep the similar architecture we used before i.e. a mainframe architecture? (Just h..

  Why valuable time is lost in planning

Valuable time is lost in planning. Substantial savings could be realized if corporations would cut down on planning and concentrate on implementing.

  How to find the "smallest" and "largest" in a series of word

Write a program that finds the "Smallest" and "Largest" in a sequence of words. After user enter the words, the program will determine which words would come first and last if the words were listed in dictionary order.

  Create simple program to demonstrate using stream i/o

Most stream I/O uses sequential access processes, but it is possible to use stream I/O for random access. The RandomAccessFile class in java.io implements random access files.

  Determine the demand for gmc cars for the coming year

GMC wants to determine its production plan at each plant in the coming year. Based on the previous data, formulate a mixed integer programming model for solving GMC's production planning-capacity expansion problem for the coming year.

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