Ask Question
30 December, 02:02

4. Calculate the square root of potato using the sqrt () function. Print out the value of potato again to verify that the value of potato hasn't changed.

+3
Answers (1)
  1. 30 December, 02:03
    0
    potato<-100

    print (potato)

    sqrt (potato)

    potato<-potato*2

    print (potato)

    Explanation:

    The complete question is as follows

    Create a variable called potato whose value corresponds to the number of potatoes you've eaten in the last week. Or something equally ridiculous. Print out the value of potato.

    Calculate the square root of potato using the sqrt () function. Print out the value of potato again to verify that the value of potato hasn't changed.

    Reassign the value of potato to potato * 2.

    Print out the new value of potato to verify that it has changed

    The question was answered using R programming language.

    At line 1, I assumed that I ate 100 potatoes in the previous week.

    So, potato = 100

    At line 2, the value of potato is printed as 100.

    At line 3, the square root of potato is calculated using sqrt function: Square for of 100 = 10

    At line 4, the initial value of potato is doubled and stored in potato variable. 100 * 2 = 200

    At line 5, the new value of potato is printed: 200.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “4. Calculate the square root of potato using the sqrt () function. Print out the value of potato again to verify that the value of potato ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers