java calculator

0 Rememberance Jakopo · February 25, 2015
hie guys i need your help on how to write a calculator program that has got an interface 

Post a Reply


Oldest  Newest  Rating
0 H. P. Lovecraft · February 25, 2015
Hi! No one is going to write any finished code for you, just to get the out of the way. =)

So what exactly do you need help with? You probably need tree classes, one for your Logic, one for your User Interface and lastly a class that enables that takes input from the User Interface and feeds it to your logic, and updates your User Interface accordingly (in this case displaying the result)

You can use this as a starting point

class Calculator {
public static void main(String[] args) {
new CalcController(new CalcView(), new CalcModel());

class CalcModel {
/* This is your for your logic */


class CalcView {
/* This is for your UI*/

class CalcController {
/* This is for handling input, o*/
private CalcView view;
private CalcModel model;

public CalcController(CalcView view, CalcModel model) {
this.view = view;
this.model = model;
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator