Many rides in amusement parks require riders to be a certain minimum height. Assume the minimum height is 48” for a ride. Write and test a function to determine whether the rider is tall enough.
function [ans] = ride(height)
height = 'no';
height = 'yes';
height = input('Whats your height: ');
ans = ride(height);
if strcmpi(ans, 'no')
disp('You cant ride')
elseif strcmpi (ans, 'yes')
I had very similar code to a classmate and wondering why it will not work? the error that occurs is "output argument "ans (and maybe others) not assigned during call to "ride"."
just wondering if anyone can help with this?