Make a game in which you guess a number

Assignment Help C/C++ Programming
Reference no: EM13161144

Make a game in which you guess a number between two set numbers to find the answer, the game should tell you if you are too low in your guess or too high. For example

Guess a number between 0 and 10

user: 9

Too high!

Guess a number between 0 and 10

user:2

Too low!

Guess a number between 0 and 10

user: 5

You win!

The number must be randomly generated each game, the following function will yield a random number between 1 and 100000:

int randNum()

{

int i

time_t t1;

(void)time(&t1);

lrand48((long)t1); /*use time in seconds to set seed*/

return lrand48()/20000;

/*lrand48() returns non-negative long integers uniformly distributed over the interval (0~100000)*/

}

where libraries sys/types.h and time.h should be included.

requirments:

The game must include at least three difficulties(bonus: add a custom difficulty so the user can define the high number), should tell you how many guesses it took to get it, must use a loop, and a switch statement. The game must also look nice.

Reference no: EM13161144

Questions Cloud

Modify each sorting algorithm : Modify each sorting algorithm so that it keeps track of the number of comparisons it performs and the number of exchanges (swaps) it performs during a single sorting operation. Keep track of these numbers using two long integer counters
Compute the equilibrium pressure of n2o4 : calculate the equilibrium pressure of N2O4(g) and NO2(g). (c) What percentage (by moles) of the original N2O4(g) is dissociated at the new equilibrium position (total pressure = 1.00 atm)?
What would be the effect on co2 production : I'm looked everywhere including my text and I can't seem to figurething one out. If someone can please explain this so I have abetter understanding I would greatly appreciate it.
What is the fertilized egg cell called after the sperm : What is the fertilized egg cell called after the sperm enters it and it attaches to the tissue in the uterus?
Make a game in which you guess a number : Make a game in which you guess a number between two set numbers to find the answer, the game should tell you if you are too low in your guess or too high. For example
Write equations for the chemical reactions : write equations for the chemical reactions that occurred between the aqueous solutions of the oxides of sulfur and calcium and between the aqueous solutions
How often would an 8-base cutter cleave : The haploid genome contains about 3*10^9 nucleotides. On average, how many DNA fragments would be produced if this DNA was digested with restriction enzyme PstI (a 6-base cutter)? RsaI (a 4-base cutter?) How often would an 8-base cutter cleave?
State the reaction vessel feels cooler : The reaction vessel feels cooler. b.The value of K becomes smaller. c.The equilibrium will shift to the left. d.The reaction vessel feels warmer.
Given an array with 100,000 entries to sort : Sorting  given an array with 100,000 entries to sort. Under what circumstances would you use each of the following: insertion sort,mergesort'quicksort

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement method to advance any given date by one day

Write C++ implementation of this method. Create and specify any other methods that you require. Include comments which will be helpful to someone who will maintain implementation in the future.

  Program to compute diameter in centimeters of a steel rod

Write a program to compute the diameter in centimeters of a steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

  Program to produce ten random permutations of numbers

In C++(must be able to compile in Visual Studio ): Write a program to produce ten random permutations of numbers 1 to 10.

  Create a class called point3d

Create a class called Point3D to represent 3D point in space, a class called Sphere and a class called Cylinder. The sphere is characterized by its center point and the radius while the Cylinder can be characterized by its center point, radius and he..

  Prepare a linux shell

Prepare a linux shell (in other words, write a C/C++ program) that will recursively prompt for input from the user. The shell should prompt as

  Write program using c language to find page fault

Write program using c language to find page fault for individual processes, group of processes and system as whole using following system call int sys_pgfltstats(pid_t pid,int flag,pf_info_struct *info).

  Create the appropriate constructor, getters and setters

Create the appropriate constructor, getters and setters for the class. Create an instance of Student for each of the students listed above from array. Construct the instance with lastname, firstname, and job.

  Write a bouncing ball video game

The balls bounces within the screen where the two horizontal walls are fixed

  Using opengl to create a cube

Write a program in C/C++ using OpenGL to create (without using built in function) a cube by implementing translation algorithm by translating along 1. X-axis, 2.Y-axis and 3. X and Y plane

  Write a program that computes the cost of long distance call

Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules.

  Struct complex

A complex number can be represented by two parts, real and image. A series complex data can be organized as a group of elements by linked list, which is shown as below: struct Complex

  Implementation of data member counter of type int

Write the implementation (.cpp file) of Counter class. Here is the full specification of the class: A data member counter of type int.

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