# Sources for project "Big digits"

• 12-21-2010, 12:24 PM
Vagabond.drv
Sources for project "Big digits"
Hi all

I have to do project:

public class Projekt {

public static void main(String[] args) {
BigDigit dl1 = new BigDigit(0);

BigDigit dl2 = new BigDigit(1500);

BigDigit dl3 = new BigDigit("987349837937497938943242");

BigDigit dl4 = new BigDigit("-999283892389281293129737812781821378");

...
}

Also in main we will have to put reckonings like:

System.out.println("dl1 = " + dl1);

The "add" is a new method in class BigDigit

dl1 = dl2.multiply(new BigDigit("2"));

System.out.println(BigDigit.fibbonacci(new BigDigit("8")));

if(dl1.equals(dl4) == true)

System.out.println("dl1 equals dl4");

else

System.out.println("dl1 does not equal dl4");

Few examples of calculations in this project.

I can't use BigInteger or BigDecimal classes, have to be as chares.

So first of all, convert all big digits to chares, then check if first char is "-"
...

For calculations like addition I have to use columnar addition char after char like:

1 1 1
+ 9 8 7
+ 7 8 9
---------
1 7 7 6

I have intentions and time, but my problem is I don't get the syntax about classes, methods, public / static, convert to other type etc. (for example, if I have homework I solve the problem in 5 mins, but I spent 2 hours, coz I don't know the syntax, so I do more like "guessing" the code and that's not the point).

So I'm asking you tell me "where I can learn stuff for that project" (books - I have Head First - Thinking in Java, net etc.), then telling me the solutions (ofc, that would be nice and helpful also :) ).

• 12-21-2010, 12:30 PM
JosAH
Basically you don't know how to program in Java because you don't know (the syntax of) the language? Have you studied the tutorials?

kind regards,

Jos
• 12-21-2010, 03:08 PM
Vagabond.drv
My main question is "what I need to know, to do this project ?" :)
• 12-21-2010, 03:37 PM
Tolls
Java.
If you don't know the syntax then you need to at least start with the early tutorials in the link Jos has given.
• 12-21-2010, 10:54 PM
Vagabond.drv
Ok thx. So if I learn everthing from these tutorials I will be able to do this project ?
• 12-21-2010, 11:03 PM
Fubarable
If you have the intelligence, aptitude and diligence for it, yes.
• 12-22-2010, 09:39 AM
Tolls
You probably only need to do the Getting Started, Learning the Java Language and Essential Java Classes ones.
• 12-22-2010, 10:00 AM
Vagabond.drv
OK, THX all much appreciate :)
• 12-22-2010, 10:03 AM
JosAH
Quote:

Originally Posted by Vagabond.drv
OK, THX all much appreciate :)

If you have studied all that you can have a look at the file src.zip in the directory where your JDK is stored (javac.exe etc.) That file contains the source code for all the classes in the SE core distribution. BigInteger.java is also in there; it doesn't harm to have a look at it.

kind regards,

Jos