brando brandido

Greenhorn
+ Follow
since Jan 11, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 brando brandido

Campbell Ritchie wrote:Why are all your methods static?



The instructions is use three methods and so therefore that what i did. Please correct me, i am beginner to java. I am willing to learn.
9 years ago

Niraj Jha wrote:It is because of calling readLine() method three times(Line number 14 , 27, 29 on br).Call it once and match your condition.......



ok i have changed it to



and now i can get the first employee id when i input 2006-0031

but then the 2nd and 3rd it displays 'no employee records!'
9 years ago
hello,

i am a bit confuse with the output of my code

this is my text file


and this is my java code



The objective of this code is to get the employee id of employees and then display employee details.

e.g. you type an employee id 2006-0031

the code will then read the text file and when that employee id is found, it then display the name of employees and other details such as employee name, base pay, net pay.

The problem with my code is that when i type the employee id 2001-0001 it displays the output correctly
but when i type an employee id 2006-0031 or 2010-0008 i will get an error.

What is wrong with my code? what is the correct coding?
9 years ago
Thank you all for all the replies, suggestions and support

i actually gt it too.

This is my own version. with comments and proper programming.

10 years ago
yes but our teacher wants us to use stringtokenizer.

so i must use it.
10 years ago
using the hint given by Manoj Kumar Jain

i gt it



but i don't like it,

i want to use tokenizer please....
10 years ago
@Manoj Kumar Jain

how am i suppose to call the 2nd line of text? and so on?
10 years ago
@Pablo Reyes

it wont work because you will end up with word like this .se-eY" the right reverse should look like this “eY – se.

this is what i did



i am able to read the first line only, i dont know how to get the next text line

the output of the above code is


my plan is to pick each word and arrange them later to get the desired output in the reverse_output.txt file
so i will pick the first two word and insert - between them, and " before them. and the the rest too.

i probably will use indexOf and substring? but don't know where to start, need idea or example to proceed.

10 years ago
sorry but our topic is all about Strings, and the teacher told us to use StringTokenizer, substring, tokens.

that's why i stick to tokenizer.

there might be a follow up discussion after this.

thnks.
10 years ago
hello i am having trouble how to reverse the given text file word by word.

this is a sample text file



need to display the text file and write it in a new file in reverse word by word.

so give the about input

the new file in reverse will look like this



this is what i got so far, i am only able to display the text file

10 years ago
Hey, kerwin, my classmate! LOL!

here is my code,

to give you idea, run this code and you'll get the first line with the amount.



finish it ok? LOL! and don't just copy all the codes or else our teacher will beat us. LOL!

the above code is not properly coded and so noob but alteast the idea is there.

----

i am a beginner in java prog too! cheers!
10 years ago
hello,

i have some text in notepad that looks like this



i am ask to create a program to call the notepad and make the output looks like this

       Product 1    Product 2    Product 3

Day 1    5000     5859.99    6001.75
Day 2    5555     7750.99    6000.50
Day 3    5877    5559.30    6578.98

i posted this in a different thread but seems the suggestion are too advance for me? i just want it simple and easy to explain.

i am a bit confuse, so i hope you guys can advice me

so so far what i've done is this;



the problem with the above code is that, the amount "5000" won't appear,

the output will look like this;


       Product 1    Product 2    Product 3

Day 1     5859.99    6001.75

Question: what should i do in order that the amount "5000" will be included in the second FOR loop?


so in my own way, for me to get the "5000" amount i modified the code to like this, and that's the time i got all the amount on day 1.



10 years ago
thank you guys,

i really appreciate all your advice and in fact i not copied the whole code ryan alfeche posted because i am afraid i won't be able to explain it if my teacher would ask me to explain the code. lol so i am careful.

i am studying more about substring and reviewing for and while loop,

will the moderator please close this thread please? or simply delete it

10 years ago
@Ryan Alfeche

thanks a lot! it works.

but, i am beginner, and i am afraid i won't be able to defend the code if a person asks me about the role of for loop and while loop

can anyone further explain line by line the code? lols

i don't seem understand yet the substring?
10 years ago
the output should be a 4 rows 4 columns, just what i've said on my first post.

the the first column is day 1, day 2, day3
the second column is Product 1, 5000, 5555, 5877
and 3rd colum is Product 2, 5859.99, 7750.99, 5559.30 and then 4th column is product 3 and so on...

so on first row, we have a blank column then Product 1 column, Product 2 column, Product 3 column
10 years ago