In my c++ class so far were up to chapter 8 which is do while loops for loops if/else if and nested ifs character arrays and everything basic before that.
Now my program in the loop section of the book is asking the user to guess a number between 1 and 100. My first guess must be 50 so I have written a case statement asking him if the number 50 or if its too high or too low . then my peers in class say that put If statements in their case statement to keep narrowing it down how would you go about doing this. I don't know how to go around coding this can someone please lead me in the right direction . Someone else a few minutes ago told me to then narrow it by the midpoint of 25 if its lower or 75 if higher and diving by two but this makes no sence to me. All I have written so far is the case statement and for
Case 1:
number; I have no idea how to put an if statement in a case and what I should have in the if statement. Oh keep in mind if anyone knows any shorter ways to do this it would be nice since I know I'll need to increment eventually somewhere. Can I please have the basics of the code for this program shown to me i'm totally lost.