The conversion depends on the temperature and other factors, but an approximation is that 1 inch of rain is equivalent to 6.5 inches of snow. W
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:3| Question number:33.3
All Answers
total answers (1)
Ch3Ex33.m
% Prompt the user for a number of inches of rain
% and call a function to calculate the
% equivalent amount of snow
rain = input('How much rain in inches: ');
snow = rainToSnow(rain);
fprintf('%.1f inches of rain would be ', rain)
fprintf('%.1f inches of snow\n', snow)
rainToSnow.m
function outsnow = rainToSnow(rain)
% Calculate equivalent amount of snow
% given rainfall in inches
% Format of call: rainToSnow(rain)
% Returns equivalent snowfall
outsnow = rain * 6.5;
end
need an explanation for this answer? contact us directly to get an explanation for this answer