Question: #### Questions ## 1.(20 points) Write a function and name it `round_num`. The input of this function is a random number `x`. The function will

#### Questions

## 1.(20 points) Write a function and name it `round_num`. The input of this function is a random number `x`. The function will round this number to the nearest integer and print "Round x to y" where y is the nearest integer.

For example, if the input value is 3.25, then the output of this function will be "Round 3.25 to 3". If the input value is 3.75, then the output will be "Round 3.75 to 4".

#Hint: You may need to use `round()` function and `paste()` function. If you are not familiar with `round()`, use `help` command.

```{r} # Run this code trunk as an example round(3.25) round(3.75) ```

```{r} # Your code ```

Verify your function by running the lines below:

```{r} round_num(8.362) ```

```{r} round_num(-7.39) ```

```{r} round_num(100.82) ```

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!