bsc

Comprehensive codebase and coursework for the 4-year B.Sc. Computer Science Honours degree (WBSU)

git clone https://github.com/notamitgamer/bsc.git
· rebuilt hourlyOpen on GitHub
root / semester_1 / R / Code / R_Code-12.r

R_Code-12.r (385B)


      1 # Write a custom function named calculate_area that takes 
      2 # two parameters: length and width. The width parameter should have 
      3 # a default value of 5. The function should print the product of the 
      4 # two parameters. Finally, call your function passing only the value 12 for the length. 
      5 
      6 calculate_area <- function(length, width = 5) {
      7     print(length * width) 
      8 }
      9 
     10 calculate_area(12)