Thanks for the help you two! I have the outlay I'm looking for, now I have another problem I've run into: my buttons don't appear to be working correctly.
I've started writing my method to convert...
Type: Posts; User: Bill_H
Thanks for the help you two! I have the outlay I'm looking for, now I have another problem I've run into: my buttons don't appear to be working correctly.
I've started writing my method to convert...
Ok, I have to make a program which converts binary to decimal and decimal to binary, making my own calculations for it. That part is no problem, but right now I'm trying to construct the basic layout...
Sorry for the delay, and thanks for the advice. I was able to get it to work, for the most part.
Now I have the problem that when multiple spaces are detected within the array, it seems to leave...
Ok, well I am making a program which takes input, changes all multiple blanks into a single blank space, and creates a new line after a sentence is declared. A sentence will be declared by finding...
Oh I'm sorry, I forgot the class.
gender = Character.toString(sex);
Now it should work.
You're in luck. Being that a string is of the String class and not a primitive variable, it has it's own methods, one of them being the toString() method. Just input the char as the parameter and it...
Ok, that all makes sense now. Thanks a lot to everyone!
Ok, that makes sense. So unless I'm doing something with reading files, I can use BufferedReader to accept the input, as long as that input is generated by the user, such as entering numbers or text,...
So, Scanner is better in the sense that it allows more specific operations to be done. And BufferedReader is more of a generic catch all, which seems to me more like a class that would be taught in...
Thanks for the comment. I guess I'll keep using Scanner then. Probably easier than learning a whole new class anyway to accomplish the same tasks with a class I already know.
I was just curious as to why I see many people in this forum using BufferedReader over the Scanner class? I don't believe I've heard of it before I came here, I've just always used the Scanner class....
No problem, glad I could help!
You're welcome!
As for part 4, I'm not entirely certain how your program works since I'm not the one making it, and just reading it doesn't always immediately click into place, but I'm guessing...
That's alright, a string would also work, but in this case I believe a single character input would limit the amount of possible errors and outcomes. In theory string will work though, as long as you...
Try defining them both right before the do while loop.
boolean repeat = false; // A value is necessary
char response
Then remove the char in front of response within the loop.
It's usually best to let someone learn on their own and just guide them than give them the answer, jeremykatz.
But in response to your question, the only import you would need is for the Scanner...
Ok, right here I notice that you have the program return a king at value 13, but at 13 or greater it returns not a card. Shouldn't this be greater than 13 like:
else if(faceValue==13) {
...
Well, once you have a basic understanding of 2d arrays, the rest of the program is just a bunch of if/else if statements and nested for loops.
As for a starting point, I'd recommend finding a good...
The easiest way I've found to loop a program is to use a do while loop around the entire thing. What you have is the original program, then a duplicate inside an if statement (which by the way needs...
You have a "{" which never closes on the first if statement on line 27.
27. if(faceValue == 1) {
28. return "Ace";
29. }
30. else if(faceValue==2) {
31. return "Two"; ...
That did it! Thanks a lot! We haven't covered recursion yet, though I've skimmed the chapter, so now I know what to do in the case of returning and repeating a method. Thanks again!
Sure! At the moment I've only got two methods, the one I was asking about in this thread, and you may notice the other one from my other thread, chronoz13. At the time of posting this, I have altered...
Yeah, I had originally use a String variable, but to reduce the amount of possible outcomes, I changed it to a char so only the first character of the text input will be read, and it allows me to use...
I need to get a method in my CommonUse class to work properly with any other class. What I'm aiming for is to use this particular method in future programs for school without having to rewrite the...
Thanks! Learn something new every day :)