Lol I'm trying to seperate the program into classes now.
The program works, it takes a file and counts the number of lines, words, and characters:
import java.io.File;
import...
Type: Posts; User: bengregg
Lol I'm trying to seperate the program into classes now.
The program works, it takes a file and counts the number of lines, words, and characters:
import java.io.File;
import...
But the program works none the less. Now I'm just working on separating the program into classes so it is object oriented.
I have My getWords
import java.util.Scanner;
/**
*
Lol nevermind silly mistake I got it...
int lineNumberAgain = 1;
int totalChars=0;
while (three.hasNextLine())
{
String lineagain = three.nextLine();
int lineChars = lineagain.length();...
I know but the problem I am gaving is with int totalChars = lineChars + totalChar; (used to be int Total = howLong + Total;
) because it says that totalChars is not initiated. When I initiate...
lineNumberAgain starts at the first line and for every loop it goes to the next line. The total is supposed to keep track of the total number of characters.
Lol, almost there.
Here is what I have for the find Characters:
File inputFileThree = new File(inputFileName);
Scanner three = new Scanner(inputFileThree);
Hey thanks for the advice. For some reason I thought I couldn't change System in, I thought it needed to be together for whatever reason. So I got it so it can count the lines and words now. However,...
So the point of the program is to input a file and have the program generate the number of lines, characters, and words. As of right not I can generate the lines and the words. However, I cannot...