Matlab Lab 11a

profileMasharmnc
lab_11a.zip

Lab 11a/calculateBounds.m

%{ calculateBounds.m This function accepts the alien attack rate and percent variance, and calculates the upper and lower bounds to be used with randomFloatValue. @param a_rate - the rate of alien attackers @param var - the percent variance of attackers @author Thomas Wilkins %} function [lower_bound, upper_bound] = calculateBounds(a_rate,var) %your code here end

__MACOSX/Lab 11a/._calculateBounds.m

Lab 11a/getFileName.m

%{ getFileName.m This function should ask the user for a filename ending in .txt and store it in the return variable filename. It should then verify that the file name ends in .txt. If it does not, then print an error message and ask the user to enter the filename again @author Thomas Wilkins %} function filename = getFileName %your code here end

__MACOSX/Lab 11a/._getFileName.m

Lab 11a/getUserValue.m

%{ This function uses a prompt string to ask the user to enter a value between min and max. The function will ask the user to enter another number with the prompt if the user enters a number that is not between min and max. @param prompt The string that prompts the user to enter a value between min and max. @param lower The lowest value that the user can enter when prompted. @param upper The highest value that the user can enter when prompted. @author Michael McCormick %} function val = getUserValue(prompt, lower, upper) %Your code goes here end

__MACOSX/Lab 11a/._getUserValue.m

Lab 11a/Lab11aRevg.doc