Question
In matlab language: Write a FOR LOOP script to solve this problem. Problem based on exercise 36 from the textbook. A food company manufactures five
In matlab language: Write a FOR LOOP script to solve this problem.
Problem based on exercise 36 from the textbook.
A food company manufactures five types of 32-oz trail mix packages using different mixtures of peanuts, almonds, walnuts, raisins and M&Ms. The mixtures can vary in the amount of each composition (with some min and max for each) but can never vary in the total weight of the package.
The data of each package manufactured is stored by day in an Excel worksheet. Your program must read each sheet separately and verify that each package complies with the min, max and total weight requirements as follows:
Each package must have a total weight of 32-oz. if the package have less or more than that, the program must say that it didnt pass the test and why (too light, too heavy)
Each package must have at least 2 of each ingredient, and 10 at most. If a package have less or more than that, the program must say that it didnt pass the test and why (which ingredients are not right and if it has too few of it or too much)
Write a program that automatically will read the excel file where the data is recorded (use xlsread command), asking the user to select which day batch will be loaded (each day batch is in a different sheet) and then, checks each package and let the person know which packages should be rejected and why.
According to the requisites, Mixes#2, 3 and 5 should be rejected, so, the message should be:
Total Rejections = 3 Rejection:
Mix 2 total weight heavier than standards Rejection:
Mix 3 Almonds exceed standard, Raisins are below standards Rejection:
Mix 5 total weight lighter than standards
Also, with the rejection information, a bell or sound (you can use the sound of your choice, having in mind that it must be short and the purpose is to inform the person that something is wrong with the batch) should be emitted (use sound command, and audioread).
To ask the user to select the Batch, please use the menu command
Peanuts (OZ) Almonds (OZ) Walnuts (OZ) Raisins (02) M&Ms (OZ) 10 10 5 5 2 5 10 10 10 10 Mix 1 Mix 2 Mix 3 Mix 4 Mix 3 2 15 00 6 10 2 5 10 5 10 5 10 12 2 Peanuts (OZ) Almonds (OZ) Walnuts (OZ) Raisins (02) M&Ms (OZ) 10 10 5 5 2 5 10 10 10 10 Mix 1 Mix 2 Mix 3 Mix 4 Mix 3 2 15 00 6 10 2 5 10 5 10 5 10 12 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started