Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    19
    Views
    1,022

    Re: java quessing game

    package project;

    import java.util.Scanner;

    public class Game {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int first = 1;
    int last = 10;
    int...
  2. Replies
    19
    Views
    1,022

    Re: java quessing game

    The code you have posted shows some of the statements you will need. Trying to write the whole program at once will make for confusion. Doing it one step at a time will be a better approach.
    Are...
  3. Replies
    19
    Views
    1,022

    Re: java quessing game

    I suggested that you work on the problem, one small step at a time. You seem to have ignored my suggestion and are trying to write the whole program at once.

    Try writing the code for the small...
  4. Replies
    19
    Views
    1,022

    Re: java quessing game

    Copy the statement(s) that you don't understand and ask a question about it.

    In this statement:
    last = 25;
    25 is a hardcoded value. last's value should be computed based on the previous values...
  5. Replies
    19
    Views
    1,022

    Re: java quessing game

    Please edit your post and wrap your code with code tags:


    YOUR CODE HERE

    to get highlighting and preserve formatting.


    The code should set the values of the variables with hardcoded...
  6. Replies
    19
    Views
    1,022

    Re: java quessing game

    That is NOT the code I was talking about. Try again. Write code that only does the simple first step as discussed in posts #8 and #4. Make a complete class, that will compile and execute. Do it:...
  7. Replies
    19
    Views
    1,022

    Re: java quessing game

    That's probably right. Now try writing the simple one step program I suggested:
    set initial values
    ask question
    move markers as per user's response
    print out new value of markers
  8. Replies
    19
    Views
    1,022

    Re: java quessing game

    Please post the code you are talking about.

    If the response is not less that means greater. Change the bottom/left to the middle.
    Have you tried the visual exercise I suggested?
  9. Replies
    19
    Views
    1,022

    Re: java quessing game

    Try doing the program in a series of small steps:
    First step:
    Change your current code to use variables as I suggested. Ask the question using the variable.
    Change the variables to new values...
  10. Replies
    19
    Views
    1,022

    Re: java quessing game

    Use variables vs hardcoding numbers:


    "is your number greater than 50? yes/no");

    Replace the 50 with a variable that starts at 50 and then is computed as the game goes on.
    Something like...
Results 1 to 10 of 10