Help - Search - Members - Calendar
Full Version: help with c++ in my computer programming class
Pixel2Life Forum > Help Section > Desktop Programming
saf
i have to wirte a program that asks the user to think of a number between 1 to 100. then the computer trys to guess the number. the program should initial guess of 50. the program should ask the user if 50 is the number the user has in mind, or if it is too high or too low. if 50 isnt right guess based on if its too high or too low. the program should make another guess. my program should continue to guess until the correct number is reached. i asked my teacher not much of a help. plzz help me.
saf
hi, i would be really glad if you can tell me how to write this program. i have to write a program that calculates the number of quaters, dimes, nickels, and pennies necessary to generate the number of cents entered as input. like for an example 84 cents is entered for input, the program should say 3 quaters, 1 nickle, 4 pennies. which adds up to 84. pllz can someone help me with this.
rc69
Moved to proper section.

We are not here to do your homework. If your teacher won't help, then that should leave whatever book you're using in class.

My hint, you are looking for a "binary search."
google.gif
rc69
QUOTE (rc69 @ Jan 13 2008, 02:13 PM) *
We are not here to do your homework. If your teacher won't help, then that should leave whatever book you're using in class.

google.gif

Same as a "roman numeral" formatter thingy (dunno what to properly call it).

Run a loop, possibly a while loop. And subtract off the highest possible number each time till you get to 0 (more work is needed of course, conditionals, etc... but that is what you basically have to do).
Metameta
another hint use the random function
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.