thanks for the help
Type: Posts; User: rockerade
thanks for the help
Thanks for all the help but I found the answer somewhere else. You were right about the {}
I inserted the {} for the block statements.
Do you see any flaws in the programming?
> 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...
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;...
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.
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: ...
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...
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 {...
After reading up a bit I realized I may be wrong about nextLine. Perhaps I should use nextInt.
Gosh I'm confused.
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...