Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calculator design problem

 
oghenekaro EFEKODO
Ranch Hand
Posts: 56
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my car has plenty of gas, tyres have air, radiator has water,
but it won't move. Please help.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47274
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic