PLEASE HELP ME AGAIN
I have an exercise: to create a program that would test if 6-digits number's sum of first three digits is equal sum of last three digits and all six digits are different, there should be used 4 methods in program. But i don't have any idea of creating all the program... I would be gratefull to get some your help.
[323 byte] By [
monika69a] at [2007-11-26 20:21:26]

> But i don't have any idea of creating all> the program.Then speak to your instructor. These forums don't work well for that.> .. I would be gratefull to get some your> help.So do what you can, post you work, and ask specific
What can I post if I first time see JAVA? I must do this exercise by tomorrow, otherwise I will drop out from the university :(please help me, I will be thankful.
This exercise really isn't difficult, it is first our exercise...
> What can I post if I first time see JAVA?
> I must do this exercise by tomorrow, otherwise I will
> drop out from the university :(
If your professor has given you this assignment, then presumably you have learned enough by now to at least start it. If you have not, then either you haven't been paying attention in class, or you simply don't have a knack for this work, or your professor is incompetent. In all those cases, the issue is to be dealt with among you, your professor, your advisor, and your school's administration.
None of these are problems to be addressed by posting an ill-formed question to a Java forum the day before the assignment is due.
> This exercise really isn't difficult,
For me it's trivial. But whether it's difficult or not is irrelevant. It would be unethical for me to do it for you, and it would be pointless for me to try to guess what part you're having trouble with.
If you truly have no idea where to start, then you need a basic intro to Java and programming, but you're already taking a class for that, and I'm not going to repeat what you already didn't learn there.
I'll give you a hint. You could have a for loop that would go from 100,000 to 999,999 and check each of the numbers for those conditions. I think the modulus operation (%) would help here too.
> I'll give you a hint. You could have a for loop that> would go from 100,000 to 999,999How would that help?
Here's a start:
public class Exercise1
{
public int firstThreeSum(int num)
{
//you implement this
}
public int secondThreeSum(int num)
{
//you implement this
}
public boolean allNumsDifferent(int num)
{
//you implement this
}
public static void main(String[] args)
{
//you implement this
}
}
You need to at least attempt to do this.
> You need to at least attempt to do this.But how can she write Java code when she's never written Java code before.
Still I'm glad she worked out the whole breathing thing before she got old enough to worry about it.
Oops. Stupid double posting idiot Jeff.Message was edited by: jverd
monika, you're probably going to suck at this to start with... allmost everyone does... My advice is to quit worrying about "getting it right", and quit worrying about "getting it wrong" ... and try SOMETHING.There's no time like the present.
how make the metod, which find all 6-digits numbers?need array or cycle?
> how make the metod, which find all 6-digits numbers?> need array or cycle?What makes up a six digit number? Yes, six digits, no more and no less.So any number in the interval [100000, 999999] would be fine.kind regards,Jos
thanks,but how I should write the method in my JAVA program, which verify whether number is 6-digits?
> thanks,> but how I should write the method in my JAVA program,> which verify whether number is 6-digits?You do know how to program simple statements in Java do you?kind regards,Jos
JosAHa at 2007-7-21 17:55:15 >

I know a little, but it is too little that I self write all this program.I know that primarily my program must verify whether number is 6-digits.I didn't know how rightly write this method.Please help me
> I know a little, but it is too little that I self> write all this program.Should've started a bit earlier then? I advice you to look through the sun java tutorial basics, work through its examples, and then try again.#
> I know a little, but it is too little that I self write all this program.
> I know that primarily my program must verify whether number is 6-digits.
> I didn't know how rightly write this method.
Suppose I wrote that method for you, then you wouldn't even be able to
recognize whether or not my method were correct because you can't
even write a simple method yourself. My suggestion is that you'd study
the basic tutorials first before you attempt do write anything at all.
kind regards,
Jos
JosAHa at 2007-7-21 17:55:15 >

I am a girl,why can't anyone guys help me...?please...
> I am a girl,What does that have to do with anything> why can't anyone guys help me...?Because you're not showing any effort or ability. Just doing it for you is not helping you.
jverda at 2007-7-21 17:55:15 >

it is example of the cycle:for (int i=0;i<n.length;i++)how I need make the cycle from interval [100,000; 999,999]..?>
> it is example of the cycle:
> for (int i=0;i<n.length;i++)
> how I need make the cycle from interval [100,000;
> 999,999]..?
First you have to unerstand what this means: for (int i=0;i<n.length;i++)
That's not a single, fixed command. It has several parts, and what exactly goes into those parts can change. For example, length is often not present at all. You need to learn what each of those parts is, so you can figure out how to use them for what you want.
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/for.html>
jverda at 2007-7-21 17:55:15 >

> I am a girl,> why can't anyone guys help me...?Yes, that's what I'm all about here too: why are all those guys so, so ...so guys!?!?!?eleven!!!?11!! Why don't they help us helpless girls?!?I'm with you girl. kind regards,Loretta ;-)
JosAHa at 2007-7-21 17:55:15 >

why can not be so:if((stm(0) + stm(1) + stm(2)) == (stm(3) + stm(4) + stm(5)))?
> why can not be so:
> if((stm(0) + stm(1) + stm(2)) == (stm(3) + stm(4) +
> stm(5)))
> ?
It's impossible to say, since you haven't shown us your code (so we don't know what stm is) and you haven't pasted in the exact error message (so we don't know wha problem is occurring).
When you post code, please use[code] and [/code] tags as described in [url=http://forum.java.sun.com/help.jspa?sec=formatting]Formatting tips[/url] on the message entry page. It makes it much easier to read.
jverda at 2007-7-21 17:55:15 >

I MADE THE PROGRAM SELF,BE BE BE... :)
> I MADE THE PROGRAM SELF,> BE BE BE... :)You go girl!
> I am a girl,
Really?! Well in that case...
public class Example1
{
public static void main(String[] args)
{
String s1 = "Icetdfo tp/frmjv.u.o/hedjp?hedD5466";
String s2 = " hae rmht:/ou.aasncmtra.satraI=138 ";
for(int i=0; i<s2.length(); i++)
{
System.out.print(s1.charAt(i));
System.out.print(s2.charAt(i));
}
System.out.println();
}
}
Turn that in. It will give you the output you need.>