R/groceryBill.R

# ## Prompts the user to enter two values, quantity and price
#
# groceryBill <- function()
# {
#
#   quantity <- readline(prompt="Enter a quantity: ")
#   quantity <- as.integer(quantity)
#   price <- readline(prompt="Enter a price: ")
#   price <- as.integer(price)
#
#   if (quantity <= 0 | price <= 0) {
#     print("Enter numeric values please.")
#   } else {
#     return(quantity*price)
#   }
#
# }
#
# print(groceryBill())
jasdumas/dumas documentation built on May 18, 2019, 4:49 p.m.