#easy problem
1 messages · Page 1 of 1 (latest)
Hey, @gleaming pawn!
Please remember to /close this post once your question has been answered!
Okay?
You want people to do your work?
Well, what is the moment when you start needing help?
And it is a problem that you didn't explain that moment at your first post
wdym
what is this attitude im not looking for someone to do my work smh
im looking for help
im learning by myself
You're saying you're looking for help, and you haven't even showed what are the parts you don't know how to do
i tried to figure it out for an hour
Still not saying what are the parts you don't know how to do
We've all been beginners. I've never been someone who would tell others: "Here is a problem. How to do it?"
So, be like me
Think how you would do this on paper not using a computer.
Would you treat it as a number? Are there some numbers that are 3 digits and some that are not? Are there rules we can use to say if a number has 3 digits or not?
(When they can't tell what's stopping them, they usually don't know how to read a number in the first place and therefore that it would be assigned to an int value.
And when they say they worked for an hour but don't show the class skeleton, they don't know how to make a class and haven't done anything.
Just general info on where people usually here at if you want to guide them)
Thanks, I'm new here, I like helping folks with programming and someone told me there's a lot of'em here 😂
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
System.out.println("please enter a three digits number");
int num = scanner.nextInt();
int units = num % 10;
// System.out.println(units);
int tens = (num / 10) % 10;
// System.out.println(tens);
int hundreds = num / 100;
// System.out.println(hundreds);
if (units == hundreds)
System.out.println("your duplicated number is: " + units);
else if (units == tens) {
System.out.println("your duplicated number is: " + units);
} else if (tens == hundreds) {
System.out.println("your duplicated number is: " + tens);
} else System.out.println("You have no duplicated numbers");
}
}```
solved
@winged moth
Glad for you but you still didn't do anything that could enable to help you.
I can't know whether you finally decided to work or whether you convinced someone else to write this for you, but at the end of the day, the bigger point is you need to describe your situation when you're in need for help
I know to give compliments. I don't know to verify whether you actually did it yourself
This doesn't account for how a number should be 3 digits. Can you modify it so that it gives an error message rather than study the digits, if it is not 3 digits?
it works but waistes little time, trial and error
wdym
like trial and error works but time is waisted
i didnt meant like that lol by trial and error i mean example u have to find
x+y=3
x-y=1
u first guess meaning u do trial so u guess x = 1 or something
then y have to be 2 but it wont work in second equation then u guess x = 2 and y =1 and it working in both but see guess waists time thats why we do systematic approach
like systematic approach for this linear equation in 2 variable is substitution method
I have no idea what you're speaking about
i was explainging trial and error
And why would you do that?
this server is for help with java, not where you find people to do your work for you
as for the so called "attitude", that isn not attitude, that is just someone pointing out that we're not here to spoon feed code to you :)