12/7/2020

Introduction

In this presentation we will present final project for Developing Data Products course in Coursera.

In this application you can calculate TAX amount by choose specific rate.

The project done by using r shiny.

User Interface

UI part below:

library(shiny) shinyUI(fluidPage(

titlePanel("TAX calculator"),

sidebarLayout(
    sidebarPanel(
        numericInput("num", h3("enter the amount"), value = 1) ,
        selectInput("Rates", "Select the rate" ,
                    choices = list("5%" , "10%" ,"15%" )) ),
    mainPanel(
        h2("TAX amount:"),
        textOutput("Tax"),
        h2("Total:"),
        textOutput("total")
  )
)

))

Server.R

Server.R part below:

library(shiny) shinyServer(function(input, output) {

    output$Tax <- renderPrint({ 
        switch(input$Rates ,
               "5%"=input$num*0.05,
               "10%"=input$num*0.10,
               "15%"=input$num*0.15)
        
})
    output$total <- renderPrint({ 
        switch(input$Rates ,
               "5%"=input$num+(input$num*0.05),
               "10%"=input$num+(input$num*0.10),
               "15%"=input$num+(input$num*0.15))
        
    })       

})

Thanks for your time

I hope you enjoy :)