Burak Ahmet

Greenhorn
+ Follow
since Feb 06, 2004
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 Burak Ahmet

Well, you are right at your guess. SavitchIn is a simle console input class. I was using it and when I go back and checked the code for it I saw the method that I was using includes some "string" stuff in it. And this is sort of controversial to what I am trying to do isn' t it. Instead of using Java's handy String class I am trying to make a true string class. Well, at least at a basic level... I am really cofused now... I think I am going back to this data structures book that I have.. I might get some inspirations
By the way, I checked the Savitch code and yes, it actually have some method that reads more than one char at a time But is it any help, I don't know..

{
/**
Reads a line of text and returns that line as a String
value. The end of a line must be indicated either by a
new-line character '\n' or by a carriage return '\r'
followed by a new-line character '\n'. (Almost all systems
do this automatically. So you need not worry about this
detail.) Neither the '\n', nor the '\r' if present, are
part of the string returned. This will read the rest of a
line if the line is already partially read.
*/
public static String readLine( )
{
char nextChar;
String result = "";
boolean done = false;
while (!done)
{
nextChar = readChar( );
if (nextChar == '\n')
done = true;
else if (nextChar == '\r')
{
//Do nothing.
//Next loop iteration will detect '\n'.
}
else
result = result + nextChar;
}
return result;
}
20 years ago
OK I ve posted two of my classes, I also have a class that contains the main method and all.. It compiles and it does most of the things I want. My problem is that I can only enter one char at a time with my current code. I am wondering if there is a way to improve this code so that I can enter:
I am done ( all at once and then let's say delete "am" or add a char or substring in a place that I want)
20 years ago
here is another one:
[ edited to format code and to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ March 11, 2004: Message edited by: Dirk Schreckmann ]
20 years ago
here is one of my classes:
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ March 11, 2004: Message edited by: Dirk Schreckmann ]
20 years ago
Hi all,
I am stuck with my csc project and need home help from the hood...This is how it goes:
-PROF wants us to write a string class-I know java already has one but he need one from us that uses singly linked list data structure.. so far so good , ha..
-I sat and actually wrote some code..
-Here the Problem comes into stage
-I can only enter one char at a time and I hated it.. I want to be able to write a whole lot more in one input and then manipulate it
-For example if this sentence is something that I put in <<<<I shoul be able to do some of these: add one character(S) at a given position, delete char(S) find a given substring etc.. Things you can do with the regular string class ..Anyway, right now somebody uses my code can enter
a
b
c
d
e
f
and for example add "s" to 2 node or delete one of the chars and I can make the whole thing added together and even do a search on it I am looking for some inspiration so that I can make it a phony string class
gotto go bed now..
20 years ago