This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calculator design problem

 
oghenekaro EFEKODO
Ranch Hand
Posts: 56
  • 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
  • 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: 49466
64
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic