You need to start with something simpler and build on it and learn the techniques.
1)How to call a method.
2)How to pass an arg to a method
3)How to receive a return value from a method.
...
Type: Posts; User: Norm
You need to start with something simpler and build on it and learn the techniques.
1)How to call a method.
2)How to pass an arg to a method
3)How to receive a return value from a method.
...
I suggest that you put this code aside for a while and work on a very simple program to see how to call a method.
Write a new class with a main() method and one other method.
Have the main()...
Please copy the text and paste it here. Images aren't that helpful.
Did you comment out the section that tries to read from the user?
Is the program waiting for the user to enter something?
The printResults() method will print something when it is called. Can you copy the full contents of the console window from when you execute the program and paste it here?
Like this. Only test the class and its methods. Leave getting user input for later:
import java.util.*;
public class LetterDriver{
public static void main(String[] args){
/*
...
Is that message from your IDE? Have you tried executing the program from the command prompt using the java command?
Did you miss my suggestion:
I suggest you comment out the while loop for now and just work with a String you define in the code for testing the methods in the LetterProfile class. Don't try to do...
I suggest you comment out the while loop for now and just work with a String you define in the code for testing the methods in the LetterProfile class. Don't try to do two things at the same time. ...
What is the while loop supposed to do? The program should ask a user a question BEFORE trying to read input from the user.
You need to review how to create an instance of a class and call its...
Where is the driver code with the calls to the methods? I don't see them in the posted code.
Is this the same problem: http://www.javaprogrammingforums.com/whats-wrong-my-code/25599-java-program-letter-frequencies-help.html
There needs to be calls made in the main() method to the methods...