Thread: Sources for project "Big digits"

1. Member
Join Date
Dec 2010
Posts
8
Rep Power
0

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 :) ).

2. 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

3. Member
Join Date
Dec 2010
Posts
8
Rep Power
0
My main question is "what I need to know, to do this project ?" :)

4. Moderator
Join Date
Apr 2009
Posts
13,541
Rep Power
26
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.

5. Member
Join Date
Dec 2010
Posts
8
Rep Power
0
Ok thx. So if I learn everthing from these tutorials I will be able to do this project ?

6. Moderator
Join Date
Apr 2009
Posts
13,541
Rep Power
26
You probably only need to do the Getting Started, Learning the Java Language and Essential Java Classes ones.

7. Member
Join Date
Dec 2010
Posts
8
Rep Power
0
OK, THX all much appreciate :)

8. 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

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•