#all letters in string same
1 messages · Page 1 of 1 (latest)
what's unclear to u? where are u stuck at? can u share ur current attempt?
I was trying
for (int i = 1; i < lowercaseInput.length(); i++) {
if (lowercaseInput.charAt(i) != firstChar) {
for (int i = 1; i < lowercaseInput.length(); i++) {
if (lowercaseInput.charAt(i) != firstChar) {
return false; character
}
}
Detected code, here are some useful tools:
for (int i = 1; i < lowercaseInput.length(); i++) {
if (lowercaseInput.charAt(i) != firstChar) {
return false;
character}
}
thats all i got till now
public static boolean areAllLettersSame
{
for (int i = 1; i < lowercaseInput.length(); i++) {
if (lowercaseInput.charAt(i) != firstChar) {
return false;
character}
}
Detected code, here are some useful tools:
public class SameLetterChecker {
public static boolean areAllLettersSame {
for (int i = 1; i < lowercaseInput.length(); i++) {
if (lowercaseInput.charAt(i) != firstChar) {
return false;
character}
}
@zealous niche if u ask chatgpt for the solution, u wont really learn it and will be stuck on the very next task again
it would be helpful if u answer the questions, then i can assist u through it and get ur attempt working
the code u provided has some syntax errors and wont compile like that
and it's also missing a main method, so u can't even run it and try it out like that
which ones?
its missing the paranthesis for the method params, the definition of what lowercaseInput and firstChar is, a return true case and that character thing is misplaced
is it ok if i ask questions?
it looks like u went head first into a too advanced topic instead of first learning the basics
that's literally what this server is for 🙂
alright thanks
ill be honest
im reaally lost when you say things as specific names
for each part
i wasnt taught with it
so i was right on the first part right?
perhaps step back and learn programming with a proper resource, such as mooc
do you have a link to it?
the general idea of ur code is correct. but its full with syntax errors and looks more like a draft/pseudocode than Java
MOOC is a completely free introductory Java course created by the University of Helsinki, it is a great way to learn Java from the ground up.
It consists of two parts, one at beginner, and another at intermediate level. The end of the course is marked by creating your own Asteroids game clone!
Even though the instructions show how to configure and use NetBeans for the course, you can use IntelliJ. To use IntelliJ, simply install the TMC plugin by opening IntelliJ -> File -> Settings -> Plugins and searching for TMC. You will then be able to use IntelliJ to complete MOOC.
Visit MOOC here: https://java-programming.mooc.fi/
(the course is available in both English and Finnish)
About the course - Java Programming
oh
thanks
cuz i was trying so desperately XD
i have an idea of things
but to many other things i have issues
its okay if i re-try to do it
and send it to you?
public class SameLetterChecker
{
public static boolean areAllLettersSame
{
for (int i = 1; i < lowercaseInput.length(); i++)
{
if (lowercaseInput.charAt(i) != firstChar)
{
return false;
}
u didnt really fix any of the mentioned issues
id suggest u start with hello world and get a proper ide
it will tell u when u do mistakes
i accidentally sent it
im editing it xD
srry
the System.out.println("Hello world"); ?
yeah but its way more than just that. stop doing pseudo
get a ide, put the full entire code in it and hit the run button
validate if it works or not
and if not, read the error messages
where?
we recommend IntelliJ
alright lemme go for it
at this point, u could also just follow mooc and learn everything by doing that
alright lemme give it a small read
im installing it
its really heavy
its taking me a while
where is the run botton?
srry im reaaally lost