Results 1 to 3 of 3

Thread: calculator Class?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2012
    Posts
    25

    calculator Class?

    I need to create a calculator class for my basic calculator application that will implement the functions of the Calculator?
    The design of the calculator class should be in this
    Name:  picClsss.PNG
Views: 303
Size:  15.9 KB

    This is what I have so far, am so confused?
    PHP Code:
    public class Calculator
        
    {
            private 
    decimal currentValue;



            public 
    Calculator()
            {
            }

            public 
    Calculator(decimal currentValue)
            {
                
    this.CurrentValue currentValue;
            }
            public 
    decimal CurrnetValue
            
    {
                
    get
                
    {
                    return 
    currentValue;
                }
                
    set
                
    {
                    
    currentValue value;
                }

            }

            public 
    decimal Add(decimal operand1decimal operand2)
            {
                return 
    operand1 operand2;
                }
            public 
    decimal Subtract(decimal operand1decimal operand2)
            {
                return 
    operand1 operand2;
            }
            public 
    decimal Multiply(decimal operand1decimal operand2)
            {
                return 
    operand1 operand2;
                }
            
            public 
    decimal Divide(decimal operand1decimal operand2)
            {
                return 
    operand1 operand2;
                }


        }

    Last edited by QuestionPlease; Nov 14th, 2012 at 11:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width