Search:

Type: Posts; User: rockerade

Search: Search took 0.19 seconds.

  1. Re: I need help! Re: strings, nextLine, while and more..

    thanks for the help
  2. Re: I need help! Re: strings, nextLine, while and more..

    Thanks for all the help but I found the answer somewhere else. You were right about the {}
  3. Re: I need help! Re: strings, nextLine, while and more..

    I inserted the {} for the block statements.

    Do you see any flaws in the programming?
  4. Re: I need help! Re: strings, nextLine, while and more..

    > run SimpleDigitAnalysis
    Please provide a list of integer data points in range [1-3]. Indicate the end of your list with 0. 1 1 1 0
    The mode is: 1
    The frequency of the mode is: 1
    >

    For...
  5. Re: I need help! Re: strings, nextLine, while and more..

    import java.util.Scanner;

    public class SimpleDigitAnalysis
    {
    public static void main(String[] args)
    {
    Scanner input = new Scanner(System.in);
    int number, count1=0, count2=0, count3=0;...
  6. Re: I need help! Re: strings, nextLine, while and more..

    No, that's the exact output. I straight copy and pasted the outcome:
    The mode is: 1
    The frequency of the mode is: 1
    In the second case I got a new blank line. Nothing happened.
  7. Re: I need help! Re: strings, nextLine, while and more..

    Sorry about that.
    I'm using Dr Java because I was having trouble with the console. Anyways, it's pretty easy to explain what the output is and what it should be.

    Say I enter the following: ...
  8. Re: I need help! Re: strings, nextLine, while and more..

    I first ask for nextInt

    Then the while statement comes in

    For as long as the nextInt does not equal 0, I read the value (if it is 1, 2 or 3) and add one to the count. When the condition in...
  9. Re: I need help! Re: strings, nextLine, while and more..

    Sorry. Here it is! Excuse my poor formatting. Note that this code is NOT working properly. I am not getting the right results.

    import java.util.Scanner;

    public class SimpleDigitAnalysis {...
  10. Re: I need help! Re: strings, nextLine, while and more..

    After reading up a bit I realized I may be wrong about nextLine. Perhaps I should use nextInt.
    Gosh I'm confused.
  11. I need help! Re: strings, nextLine, while and more..

    FIRST, understand that I'm not merely seeking the answer to this assignment question. I'd like to learn:-bd!

    First, I'll overview the question:

    I am to write a program that takes a list of...
Results 1 to 11 of 11