Good day. Pliz tell me options. Initially there is a calculator that can add, divide, multiply, subtract numeric types: int, long, float, double. I want to add a remainder operation and enter a new data type, for example, Date. Tell me the structure of the program so that you can easily expand the library? Thank.

Closed due to the fact that the issue is too common for participants Vladimir Martyanov , aleksandr barakin , Kromster , pavel , HamSter Nov 23 '16 at 6:38 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Under the calculator is meant a full syntactic analysis of the string and the calculation of the result? - Victor Khovanskiy

1 answer 1

Introduce the ICalc interface, implement the calc (params) function, create the child classes "heirs" of the interface, implement the logic of each action. And what structure is --- calc. -> MainApp.class --- handlers -> iCalc, Plus, ...., .class