- Welcome!
- Today, I’ll be presenting a simple Shiny application: A Tip Calculator.
2025-01-19
(Insert a screenshot of your running Shiny app here)
Key Features:
calculate_tip <- function(bill_amount, tip_percentage) {
tip_amount <- bill_amount * (tip_percentage / 100)
total_bill <- bill_amount + tip_amount
return(c(tip_amount = round(tip_amount, 2), total_bill = round(total_bill, 2)))
}
# Example usage
bill_amount <- 50
tip_percentage <- 20
calculate_tip(bill_amount, tip_percentage)
## tip_amount total_bill ## 10 60