Question: Using Rstudio 1. create a script that generate a random number (between 1 to 10) (need to research on the correct random function), Display the

Using Rstudio

1. create a script that generate a random number (between 1 to 10) (need to research on the correct random function), Display the number and store it in var1.

2. Run step 1 to generate a second number (say var2). Display the number and add the number to the number in step 1 (var1 <- var1 +var2).

3. Use IF statements and run the following: If var1 below 16, repeat step 2. If the number is between 16 and 21, print out a statement "hold" and stop the game. If var1 is above 21, print out a statement "busted" and stop the game.

Include the R code and screenshot of how the code ran.

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!