R/compare_response.R

Defines functions compare_response

Documented in compare_response

#' User Inputs Size Comparison
#'
#' @param res1 This is the first value the user inputs
#' @param res2 This is the second value the user inputs
#'
#' @return This returns a line with the result of comparison of two inputs
#' @export
#'
#' @examples
#' compare_response()
compare_response <- function(res1, res2){
  res1 = readline(prompt("Please input the 1st number  "))
  res2 = readline(prompt("Please input the 2nd number  "))
  if (res1 > res2){
    output <- c("Your 1st input is bigger!")
  }
  if (res1 == res2){
    output <- c("Your inputs are equal.")
  }
  else {
    output <- c("Your 2nd input is bigger!")
  }
  return(output)
}
hzwangjiren/jiren441final documentation built on Jan. 1, 2021, 3:23 a.m.