用java寫簡單計算程式

需要一個用java寫的簡易的計算機程式因為我才剛學java沒多久

只需要基本的加減就可以了

語法盡量簡單,如果能加上註解會更好

拜託各位高手了

謝謝!!

不過其實重點在要有"視窗".."按鈕"...

一直以來都在用c寫簡單IO程式而已

要做成像銀幕小計算機那樣不知道怎麼下手..

拜託了!!

1 個解答

評分
  • Chen
    Lv 6
    8 年前
    最佳解答

    2 method:

    1. build binary tree and parse with postfix ( the method need stack for operand ). the method is stupid, but general people adopts it.

    2. adopt LL / LR method: You work as coding compiler.

    statement -> expression

    expression -> simple_expression relation_operand simple_expression

    | simple_expression

    simple_expression -> terminal + terminal

    | terminal - terminal

    | terminal

    terminal -> factor * factor

    | factor / factor

    | factor

    factor-> ID

    | number

    | float

    | ( expression ) ===> recursive descent

    I suggest You should adopt second method.

    I have experienced in coding OS of supercomputer(VAX, CDC CYBER) since I was 10 years old, Now I am good at database design( B*tree, Rtree, transaction process, parse SQL ) like ORACLE, compiler and linker design, virtual reality( 3D)and image processing, machining learing, data mining, face recognition, hand writting recognition, biometrics and bioinformatics ...etc. above mentioned knowledges learns process by myself.

還有問題?馬上發問,尋求解答。