Skip to content

Instantly share code, notes, and snippets.

View LControl-code's full-sized avatar
🏠
Working from home

Adam Stratilík LControl-code

🏠
Working from home
  • Slovakia
View GitHub Profile
class Calculator {
    private double currentResult = 0;
    private String pendingOperator = null;

    public void enterNumber(final double number) {
        if (this.pendingOperator == null) {
            this.currentResult = number;
        } else {
            this.currentResult = this.executeOperation(this.currentResult, number, this.pendingOperator);