[Solved] One Week Cds 130 Final Exam Buy Bag Peanut M M S Gmu Bookstore Allergic Peanuts Bought New Q37280254
I need a matlab code for below question

One week before your CDS-130 Final Exam, you buy a bag of Peanut M&M’s in the GMU Bookstore. (If you are allergic to Peanuts, then you bought the new TOFU M&M’s. [They don’t melt in your hand or anyplace else for that matter.. Since you are watching your waist line, you decide to ONLY eat a few M&Ms each day and give 3 to your roommate while they help you study each night. (Very thoughtful!). Now here’s the problem: .When you open the bag of M&M’s there are 35 M&M’s in the bag. You are to use the “randi” function to select a random integer between 1 and 6 (both inclusive). This is number is the number of M&Ms that you eat that day. So subtract that number of M&Ms from your bag of M&Ms. ALSO, each day you give 3 M&Ms to your roommate. These are separate from your “draw of M&Ms for you to eat. Be sure to subtract these from your inventory of the number of M&Ms as well each day Develop a simulation using there are no M&Ms left. The logical test you do each morming is M&Ms in the bag, then you repeat the 2 draws of M&Ms. So the logic test is if the count of M&Ms is>0, you draw. Don’t forget to increment the number of the day M&Ms will last before that if you have one or more g a WHILE loop to find out how long your QUESTIONS: 1) 2) How many days will your M&Ms last? The day you open the bag is Day #1 Run your simulation of M&M snacking 5 times. How many of the simulations do your M&Ms last until your CDS-130 Final Exam begins? (aka: 7 or more days) Show transcribed image text One week before your CDS-130 Final Exam, you buy a bag of Peanut M&M’s in the GMU Bookstore. (If you are allergic to Peanuts, then you bought the new TOFU M&M’s. [They don’t melt in your hand or anyplace else for that matter.. Since you are watching your waist line, you decide to ONLY eat a few M&Ms each day and give 3 to your roommate while they help you study each night. (Very thoughtful!). Now here’s the problem: .When you open the bag of M&M’s there are 35 M&M’s in the bag. You are to use the “randi” function to select a random integer between 1 and 6 (both inclusive). This is number is the number of M&Ms that you eat that day. So subtract that number of M&Ms from your bag of M&Ms. ALSO, each day you give 3 M&Ms to your roommate. These are separate from your “draw of M&Ms for you to eat. Be sure to subtract these from your inventory of the number of M&Ms as well each day Develop a simulation using there are no M&Ms left. The logical test you do each morming is M&Ms in the bag, then you repeat the 2 draws of M&Ms. So the logic test is if the count of M&Ms is>0, you draw. Don’t forget to increment the number of the day M&Ms will last before that if you have one or more g a WHILE loop to find out how long your QUESTIONS: 1) 2) How many days will your M&Ms last? The day you open the bag is Day #1 Run your simulation of M&M snacking 5 times. How many of the simulations do your M&Ms last until your CDS-130 Final Exam begins? (aka: 7 or more days)
Expert Answer
Answer to One week before your CDS-130 Final Exam, you buy a bag of Peanut M&M’s in the GMU Bookstore. (If you are allergic to Pea… . . .
OR

