Kishore

Greenhorn
+ Follow
since Aug 26, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kishore

Hi,,,
I am new to servlets and I was willing to work on it. But I just want to know what to install to run the servlets.
My system just has Jbuilder 6.0 in it. To run the servlets what are the software to be installed and how to run it. I tried to install JSDK and installed jdk too. It is quite confusing to me. Please help me run the programs on servlets.
As I am a novice please guide me step by step what to install and how to set the path.
Thanking you guys...
20 years ago
No Sir.
Basically i am supposed to calculate the count of operators and operands in a 'c' file.
I could calculate the operators, but i need a small logic to calculate the operands.
Please help me out.
Thanking you,
Sincerely,
21 years ago
Just a small logical question
Can operands can be calculated by subtracting operators from words in a file.
Just help me out.
Thanking you,
K K
21 years ago
My Basic question is how to calculate the operands. I mean i need a small logic. Am i supposed to use nextToken() method to calculate tne next character as a operator and using previousToken() method for a space. As i am not able to find a good logical code. Please help me out.
Thanking you,
21 years ago
Here is the total code..i wrote till now..i was able to calculate the operator.. but i want a idea how to calculate the operands.
It didnt work using operators as delimiters.
Please help...

--------------------
JAI SHRI KRISHNA
K K
[ November 14, 2002: Message edited by: Michael Ernest ]
21 years ago
Here is the total code..i wrote till now..i was able to calculate the operator.. but i want a idea how to calculate the operands.
It didnt work using operators as delimiters.
Please help...
import java.io.* ;
import java.util.*;
public class Application1 extends Reader
{
Reader in = null;
int read = 0, charCount=0, wordCount = 0,
lineCount = 0;
int operators;
boolean whiteSpace = true;
char[] operat = {'+','-','/','*','%'};
public Application1 (Reader r)
{
in = r;
}

/**
* Implementation for parent's read method. Counts
* chars, words, and lines.
*/
public int read(char[] array, int off, int len)
throws IOException
{
if (array == null)
throw new IOException("Null array");
// Do actual read
read = in.read(array, off, len);
// Now count
charCount += read;
// Increment character count
char c;
for (int i=0; i < read; i++)
{
c = array[i];
if (c==operat[0]||c==operat[1]||c==operat[2]||c==operat[3]||c==operat[4])
operators++;
// Line count
if (c == '\n')
lineCount++;
// Word count
if (Character.isWhitespace(c))
whiteSpace = true;
else
if (Character.isLetterOrDigit(c)
&& whiteSpace)
{
wordCount++;
whiteSpace = false;
}
}
return read;
}

public void close() throws IOException
{
in.close();
}

public int getCharCount() { return charCount; }
public int getWordCount() { return wordCount; }
public int getOperatorCount() { return operators; }
public int getLineCount() { return lineCount; }
/** Test driver */
public static void main(
String args[]) throws Exception
{
Application1 cr = new Application1(new
FileReader("c:/test.txt"));
char c[] = new char[4096];
int read = 0;
while ((
read = cr.read(c, 0, c.length)) != -1)
System.out.print(new String(c, 0, read));
cr.close();
System.out.println(
"\n\nRead chars: " + cr.getCharCount() +
"\n words: " + cr.getWordCount() +
"\n lines: " + cr.getLineCount() +
"\n operators: " + cr.getOperatorCount());
}
}//end of class
21 years ago
I wrote a code to count the number of operators and operands in a file. I was able to calculate the count of operators, but stuck at the operands. Do i need to use hasNextToken() method, or something else. Please Help this novice.
Thank you,
Kishore Kumar Bokkala
21 years ago
Can any one give me the code to calculate the lines of code, spaces, functions, dataflow in a C Program.
As i am a novice to JAVA, I hope some one would help me in this..
Thanks
21 years ago
Hello Java Professionals..
Can you just help me out with source code in java to calculate the lines of code, comments, and the dataflow of a C file.
My project is chiefly on software measurement, ie the calculating the complexity of the program. I would really appreciate if any one would help me out in getting me the code. I have written the code, but i am a bit confused.
I hope you help me guys..
KK
21 years ago
Hello Java Professionals..
Can you just help me out with source code in java to calculate the lines of code, comments, and the dataflow of a C file.
My project is chiefly on software measurement, ie the calculating the complexity of the program. I would really appreciate if any one would help me out in getting me the code. I have written the code, but i am a bit confused.
I hope you help me guys..
KK
21 years ago