Results 1 to 9 of 9
  1. #1
    Vagabond.drv is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default 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:

    dl1 = dl2.add(dl3);

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

    Thx for any advices :)

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default

    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
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Vagabond.drv is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default

    My main question is "what I need to know, to do this project ?" :)

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,089
    Rep Power
    20

    Default

    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. #5
    Vagabond.drv is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default

    Ok thx. So if I learn everthing from these tutorials I will be able to do this project ?

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,089
    Rep Power
    20

    Default

    You probably only need to do the Getting Started, Learning the Java Language and Essential Java Classes ones.

  8. #8
    Vagabond.drv is offline Member
    Join Date
    Dec 2010
    Posts
    8
    Rep Power
    0

    Default

    OK, THX all much appreciate :)

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Vagabond.drv View Post
    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
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 1
    Last Post: 07-09-2010, 12:33 PM
  2. Replies: 1
    Last Post: 06-30-2009, 02:32 PM
  3. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  4. Replies: 1
    Last Post: 10-20-2008, 07:35 AM
  5. project about "network print spooler"
    By rakesh in forum Networking
    Replies: 0
    Last Post: 01-29-2008, 07:48 AM

Posting Permissions

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