Lesson 11 Learning construction Step 6 Solution

by nathanesa

JavaScript

function canIRide(ridersName, ridersHeightCM) {
  if (ridersHeightCM > 140) {
    document.write(ridersName + ' can go on the ride<br>');
  } else {
    document.write(ridersName + ' is not tall enough<br>');
  }
}

canIRide('Julie', 130);
canIRide('Michael', 145);
canIRide('Hafsna', 136);
canIRide('Yoshiko', 165);
canIRide('Dusan', 124);
canIRide('Elsie', 118);
canIRide('Tim', 139);