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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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