2025-08-10

Objective

The objective of this project is to provide a simple calculator app that supports basic addition, subtraction, multiplication and division. An example is shown below.

input<-NULL
input$operator <- "/"
input$first <- 10
input$second<-5
if(input$operator=="+"){
        print(input$first+input$second)
      }else if(input$operator=="-"){
        print(input$first-input$second)
      }else if(input$operator=="*"){
        print(input$first*input$second)
      }else if(input$operator=="/"){
        print(input$first/input$second)
      }
## [1] 2

Feature Specifications

  • First number: This is the first number in the equation to be calculated. This can be any real number, so long as it falls within the minimum and maximum values that can be processed by the computer.
  • Second number: This is the second number in the equation to be calculated. This can be any real number, so long as it falls within the minimum and maximum values that can be processed by the computer.
  • Operator: Specifies whether the two numbers should be added, subtracted, multiplied, or divided.

How to Use

  • The numbers can be selected by typing in input.
  • The operator can be selected by choosing the desired operator from the dropdown menu.
  • Press the “Calculate” button to see the result.

Project Specifications

  • The application provides input by asking for numerical values and an operator to perform a calculation on.
  • The calculation is performed in the server.R file within the app, fulfilling the “operation on ui input” project requirement.
  • Reactive output is displayed as a result of the server calculations in the main panel of the project under the title “Result”.
  • Documentation is provided via text-based instructions on the Shiny app.