All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Paul Clapham wrote:I moved the thread to "Beginning Java".
Sara Lyons wrote:
//this loop doesnt really work and I don't know what to do after the if statement
//im trying to delete duplicate characters in this loop and if statement but not really sure how to go about it
...Any help would be great
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:
Sara Lyons wrote:
//this loop doesnt really work and I don't know what to do after the if statement
//im trying to delete duplicate characters in this loop and if statement but not really sure how to go about it
...Any help would be great
Before you even write a line of code, you need to stop and think about how you do things.
Think about it in English - not Java. If I gave you a piece of paper with a string of characters on it, how would YOU remove duplicate characters?
Sai Hegde wrote:
Paul Clapham wrote:Sara, is it possible that you might be asked to explain that solution? Because I have the feeling that you don't completely understand it. If that happened, then you might be in trouble for plagiarism. And it's not a beginners technique that you've been given there, so using it might well cause the examiners to become suspicious.
Unless the rules for your exam specifically allow you to get help from other people, that is. In that case you would be in the clear.
Sara Lyons wrote:
Paul Clapham wrote:Sara, is it possible that you might be asked to explain that solution? Because I have the feeling that you don't completely understand it. If that happened, then you might be in trouble for plagiarism. And it's not a beginners technique that you've been given there, so using it might well cause the examiners to become suspicious.
Unless the rules for your exam specifically allow you to get help from other people, that is. In that case you would be in the clear.
No it's no problem if I get help, sure my lecturers always saying when your stuck ask anyone but if this was an assignment then it would be a different story.
No I didn't really understand what ("(\\w)\\1+", "$1") and ("\\P{L}", "") mean in "String enter3= enter2.replaceAll("(\\w)\\1+", "$1")" and "String enter1 = enter.replaceAll("\\P{L}", "")".
Henry Wong wrote:
Sara Lyons wrote:
Paul Clapham wrote:Sara, is it possible that you might be asked to explain that solution? Because I have the feeling that you don't completely understand it. If that happened, then you might be in trouble for plagiarism. And it's not a beginners technique that you've been given there, so using it might well cause the examiners to become suspicious.
Unless the rules for your exam specifically allow you to get help from other people, that is. In that case you would be in the clear.
No it's no problem if I get help, sure my lecturers always saying when your stuck ask anyone but if this was an assignment then it would be a different story.
No I didn't really understand what ("(\\w)\\1+", "$1") and ("\\P{L}", "") mean in "String enter3= enter2.replaceAll("(\\w)\\1+", "$1")" and "String enter1 = enter.replaceAll("\\P{L}", "")".
Another issue is that you may be using a feature that you didn't learn.... In this case, using the regular expression engine when the goal of the assignment is to use loops, conditions, arrays, and assignments is not a good idea.
Henry
Sara Lyons wrote:Emm I'd cross them off the paper?? I'm so bad at java epic fail tomorrow .
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Sara Lyons wrote:
Henry Wong wrote:
Another issue is that you may be using a feature that you didn't learn.... In this case, using the regular expression engine when the goal of the assignment is to use loops, conditions, arrays, and assignments is not a good idea.
Henry
Ye thats grand just figured out how to do it in a loop and we're already using that feature just hardly attend the lectures to know it
Henry Wong wrote:
Sara Lyons wrote:
Henry Wong wrote:
Another issue is that you may be using a feature that you didn't learn.... In this case, using the regular expression engine when the goal of the assignment is to use loops, conditions, arrays, and assignments is not a good idea.
Henry
Ye thats grand just figured out how to do it in a loop and we're already using that feature just hardly attend the lectures to know it
Not sure if I understand what you are trying to say. Are you saying... "you figured it out using loops -- you solved it. And everything is all good"? Or are you saying ... "you just found out that you need to do it using loops -- and you can't use the previously provided solution that you don't understand"?
Henry