Preprogrammed Voice Messages Incident Message Leader Activate DPS 1 Fire Temporal horn continuous-no voice message None 2 Tornado Tornado warning, take shelter Slow whoop Y 3 Active shooter Active Shooter, Police Responding, Stay in Place Attention Attention Y 4 General Alert WMU Alert, Check WMU homepage Attention Attention Y 5 This is a test This is a test of the emergency system Attention Attention Y 6 Test of fire alarm This is a test of the fire alarm Attention Attention Y 7 Test of active shooter This is a test of the active shooter alert 8 Test of tornado message This is a test of the tornado warning 9 Test of WMU Alert message This is a test of the WMU alert 10 All Clear test Testing has ended 11 All clear fire Fire emergency has ended 12 All clear general alert WMU alert has ended 13 All clear weather Tornado warning has ended 14 All clear active shooter Active shooter emergency has ended Attention Attention Attention Attention Attention Attention Attention Attention Attention Attention Attention Attention Attention Attention Attention Attention Activat e Local Y Y Y Y Y Y Y Y Y Y Y Y Y
# include < iostream > // For cout and cin # include < string > // For string objects # include "Bag.h" // For ADT bag using namespace std; int main () { string clubs [] = {"Joker", "Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"}; // Create our bag to hold cards. Bag < string > grabBag; // Place six cards in the bag. grabBag.add (clubs [1]); grabBag.add (clubs [2]); grabBag.add (clubs [4]); grabBag.add (clubs [8]); grabBag.add (clubs [10]); grabBag.add (clubs [12]); // Get friends guess and check it. int guess = 0; while (!grabBag.isEmpty ()) { cout << "What is your guess?" << "(1 for Ace to 13 for King):"; cin >> guess; // Is card in the bag? if (grabBag.contains (clubs [guess])) { // Good guess remove card from the bag. cout << "You get the card!\n"; grabBag.remove (clubs [guess]); } else { cout << "Sorry, card was not in the bag.\n"; } // end if } // end while cout << "No more cards in the bag. Game over!\n"; return 0; } ; // end main
Two questions: What happens to the capacity reserved for the high paying segment, when the high paying segment starts paying about the low paying segment? – How much does the high paying segment value quick service? We never consider the distribution of the demand for low paying segment when computing the reserved capacity for the high paying segment. Can this be correct, why? 12 utdallas.edu/~metin
Guess&Check Demo Make a Time Guess, tGuess Calc VGuess = V(tGuess) Calc % Full for the Guess V t 109 108 1 e t 100 rt Guess% Vinit 109 Calc Difference del Goal% Guess% Guess AGAIN Engineering/Math/Physics 25: Computational Methods 9 Bruce Mayer, PE [email protected] • ENGR-25_HW-01_Solution.ppt
Functional Information Systems ctd. “Front-end” (Customer Interface) Systems • • these are important because? it’s easiest to answer this by contrasting an effective system with some common negative comments (and experiences) – – – – “I’m sorry, the system won’t let me do that” “I’m sorry, the system has no record of that” “I’m sorry, you don’t appear to be registered” “I’m sorry, the system is down and I can’t help you” – some of these responses may be due to “back-end” problems as we shall see later in the course, but some are because of front-end inadequacies www.infotech.monash.edu.au 20
Looping Statements Read in square Set guess to square/4 Set epsilon to 1 WHILE (epsilon > 0.001) Calculate new guess Set epsilon to abs(square - guess * guess) Write out square and the guess 26
Note that the random number is generate once outside the do loop while the user guess is prompted when you look back for JavaScript guess number game another try. I choose a do loop since I always
EXAMPLE Player 1 Player 2 x is chosen, please provide a guess Smaller than x, next guess Smaller than x, next guess Smaller than x, next guess Smaller than x, next guess STOP! x = 37 1 3 10 28 76 Performance Ratio 118 / 37 = 3.189189
EXAMPLE Player 1 Player 2 x is chosen, please provide a guess Smaller than x, next guess Smaller than x, next guess Smaller than x, next guess Smaller than x, next guess STOP! x=5 1 2 3 4 23 Performance Ratio (1+2+3+4+23) / 5 = 6.6
EXAMPLE Player 1 Player 2 x is chosen, please provide a guess Smaller than x, next guess Smaller than x, next guess Smaller than x, next guess Smaller than x, next guess STOP! x = 48 = 0.419 exp() = 1 exp(+1) = 4 exp(+2) = 11 exp(+3) =30 exp(+4) = 83 Performance Ratio 129 / 48 = 2.6875
EXAMPLE Player 1 Player 2 x is chosen, please provide a guess Smaller than x, next guess Smaller than x, next guess Smaller than x, next guess Smaller than x, next guess STOP! x = 63 = 0.866 exp() = 2 exp(+1) = 6 exp(+2) = 17 exp(+3) =47 exp(+4) = 129 Performance Ratio 201 / 63 = 3.190476
Substitution examples T(n) = 2T(n/2) + kn, T(1)=c’ (e.g., merge sort) T(n) = 2T(n/2) + k, T(1)=c’ (e.g., D&C search) Guess T(n) <= c.nlgn does not work Guess T(n) <= c.nlgn +dn works for d>=c’, c>=k Guess T(n) <= cn does not work Guess T(n) <= cn-d works for d>=k, c>=d+c’ T(n) = 2T(√n) + k.lg n Change variable first Must prove the exact form guessed; otherwise revise your guess
To understand the universe, scientists use the “Scientific Method” 1. Observe - Observe something. Write down the observations and make sure that other people can repeat them on their own. 2. Guess - Make a guess about how that something happens. The guess has to be in the form of an explanation that can be used in other contexts. The guess must help to make predictions about other observations. 3. Test and Criticize - Observe similar things to see if the guess (the explanation) is correct or needs to be modified. 4. Repeat - until you get it right.
To understand the universe, scientists use the “Scientific Method” 1. Observe - Observe something. Write down the observations and make sure that other people can repeat them on their own. 2. Guess - Make a guess about how that something happens. The guess has to be in the form of an explanation that can be used in other contexts. The guess must help to make predictions about other observations. 3. Test and Criticize - Observe similar things to see if the guess (the explanation) is correct or needs to be modified. 4. Repeat - until you get it right.
The Power of the First Guess • The first guess (an earlier 6 or 12 hour forecast) is the model’s initial impression of the atmosphere’s current condition. • The first guess is innocent until proven guilty. • The first guess is most easily modified in datarich areas (i.e., CONUS) • The first guess is least easily modified in data poor areas (i.e. oceans, etc…)
Looping Statements Read in square Set guess to square/4 Set epsilon to 1 WHILE (epsilon > 0.001) Calculate new guess Set epsilon to abs(square - guess * guess) Write out square and the guess 26