# Search:

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

Replies
19
Views
1,737

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

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

Replies
19
Views
1,737

### 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. ## Thread: I need help! Re: strings, nextLine, while and more..

Replies
19
Views
1,737

### 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. ## Thread: I need help! Re: strings, nextLine, while and more..

Replies
19
Views
1,737

### 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. ## Thread: I need help! Re: strings, nextLine, while and more..

Replies
19
Views
1,737

### 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. ## Thread: I need help! Re: strings, nextLine, while and more..

Replies
19
Views
1,737

### 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. ## Thread: I need help! Re: strings, nextLine, while and more..

Replies
19
Views
1,737

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

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. ## Thread: I need help! Re: strings, nextLine, while and more..

Replies
19
Views
1,737

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

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. ## Thread: I need help! Re: strings, nextLine, while and more..

Replies
19
Views
1,737

### 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. ## Thread: I need help! Re: strings, nextLine, while and more..

Replies
19
Views
1,737

### 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.