Computer science project

profileJerry Shen
Feedbackfortheclass.docx

Hi Everyone,

Checkpoint results are now posted in Blackboard. Great work!

A few notes:

-Double check file names, import lines, and indentation.

-Check for infinite loops. If your file got stopped b/c of the infinite loop in the debugging I commented or exited out of it so you could still get results. But there were other student-created infinite loops.

-No tests for Main Program. Some tests for EC.

-Unless you see the printed messaged "Testing failed" under a test, your code passed the test

-All of the lotto prize tests show the inputs and your return value - you can figure out the expected return value from the inputs

-Double check you followed instructions ESPECIALLY for the debugging

-Here's an example of a run with no errors with a few notes on some tests:

generate_numbers_default_limit: #default for limit Generated [12, 34, 32, 24, 8, 1, 18, 17] Checking min, max, length, and frequency . generate_numbers_default_num: #default for num Generated [7, 125, 143, 135, 139] Checking min, max, length, and frequency . generate_numbers_defaults: #default for both Generated [5, 3, 23, 24, 7] Checking min, max, length, and frequency . generate_numbers_equal: #num and limit equal, forces every number up to limit to be used Generated [6, 4, 3, 8, 9, 2, 5, 10, 1, 7] Checking min, max, length, and frequency . generate_numbers_rand_test: #checks randomness, selections are only 1,2,3 - checks frequency of each possible combination and for incorrect limits Out of 60000 items, 9808 were [1,2,3]. Expected ~10000. 9975 were [2,1,3]. Expected ~10000. 9954 were [3,1,2]. Expected ~10000. 10097 were [1,3,2]. Expected ~10000. 10074 were [2,3,1]. Expected ~10000. 10092 were [3,2,1]. Expected ~10000. 0 did not match the specified options. THIS MUST BE 0. . lotto_prize_prize_even: attempt: [5, 15, 2, 24] winning: [2, 25, 19, 24] prizes: [10000, 562] Return value was 0 . lotto_prize_prize_even_2: attempt: [5, 15, 200, 24] winning: [200, 15, 19, 24] prizes: [10000, 562] Return value was 562 . lotto_prize_jackpot_same: attempt: [5, 15, 2, 24, 56] winning: [5, 15, 2, 24, 56] prizes: [10000, 1000, 100, 10, 1] Return value was 10000 . lotto_prize_jackpot_shuffle: #numbers out of order - all tests that say shuffle attempt: [5, 15, 2, 24, 56] winning: [24, 15, 56, 2, 5] prizes: [10000, 1000, 100, 10, 1] Return value was 10000 . lotto_prize_jackpot_shuffle_2: attempt: [5, 15, 2, 24, 56] winning: [24, 35, 56, 2, 5] prizes: [10000, 1000, 100, 10, 1] Return value was 1000 . lotto_prize_lose: attempt: [5, 15, 2, 24, 56] winning: [44, 35, 13, 20, 11] prizes: [10000, 1000, 100, 10, 1] Return value was 0 . lotto_prize_prize_odd: attempt: [5, 15, 2, 24, 56] winning: [44, 35, 13, 2, 11] prizes: [10000, 1000, 100] Return value was 0 . lotto_prize_prize_odd_2: attempt: [5, 15, 2, 24, 56, 77, 19] winning: [44, 35, 13, 2, 11, 19, 42] prizes: [10000, 1000, 100] Return value was 0 . lotto_prize_prize_odd_3: attempt: [5, 15, 2, 24, 56, 77, 19] winning: [44, 15, 13, 2, 11, 19, 42] prizes: [10000, 1000, 100] Return value was 0 . lotto_prize_prize_odd_4: attempt: [5, 15, 2, 24, 56, 77, 19] winning: [24, 15, 13, 2, 11, 19, 56] prizes: [10000, 1000, 100] Return value was 100 . lotto_prize_prize_odd_5: attempt: [5, 15, 2, 24, 56, 77, 19] winning: [24, 15, 23, 2, 11, 19, 56] prizes: [10000, 1000, 100] Return value was 100 . lotto_prize_prize_one: attempt: [5, 15, 2, 24, 56, 77, 19] winning: [24, 15, 23, 2, 11, 29, 56] prizes: [10000] Return value was 0 . lotto_prize_prize_one_2: attempt: [5, 15, 2, 24, 56, 77, 19] winning: [2, 5, 19, 24, 77, 15, 56] prizes: [10000] Return value was 10000 . lotto_prize_shuffle_3: attempt: [5, 15, 2, 24, 56] winning: [44, 35, 56, 2, 5] prizes: [10000, 1000, 100, 10, 1] Return value was 100 . lotto_prize_shuffle_4: attempt: [5, 15, 2, 24, 56] winning: [44, 35, 56, 2, 11] prizes: [10000, 1000, 100, 10, 1] Return value was 10 . lotto_prize_shuffle_5: attempt: [5, 15, 2, 24, 56] winning: [44, 35, 13, 2, 11] prizes: [10000, 1000, 100, 10, 1] Return value was 1 . simulate_lotto_max_plays: #forces max plays Return value was 10 . simulate_lotto_max_plays_large: #forces max plays Return value was 1500 . simulate_lotto_mult_MC: #based on Monte Carlo simulation - runs the function many times and calcs average, if you failed this, there is a small chance your code is OK - depends on probability On average, it took 9.8915 plays before you ran out of money. . simulate_lotto_single: #length of attempt and limit are the same, so must win on first play, inputs are [1,2,3,4,5] and 5 Return value was 1 .