File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "calculator design problem" Watch "calculator design problem" New topic

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

Joined: Oct 13, 2005
Posts: 46362
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:
subject: calculator design problem
It's not a secret anymore!