File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes calculator design problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "calculator design problem" Watch "calculator design problem" New topic
Author

calculator design problem

oghenekaro EFEKODO
Ranch Hand

Joined: Oct 10, 2005
Posts: 56
pls i need help,i was trying to design a calculator but face the following problem:after creating a class for the KeyPad,a class for Display(i.e screen),and a class for Maths(i.e operators).Couldn't bring them to function one entity.pls tell what to do in order get my calculator working.thanks
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
my car has plenty of gas, tyres have air, radiator has water,
but it won't move. Please help.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38075
    
  22
You divide a visual app up into MVC. M=model, V=view, and C=control.
You have the "V" in the form of the keys and display, and you have part of the "C" in the form of your maths class.


Now you need the "M" bit which takes the numbers from the keys, passes them to the maths class, gets the result back, and passes that to the display.
The "M" bit can mean the data you are dealing with or the way the whole things hangs together.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calculator design problem
 
Similar Threads
'Encapsulate what varies' Question
scjp 1.4 exam query
Java rich client design patterns: where to find?
Threading discrepancies
Synchronization example in KS&BB