%%CODE FOR INGRIEDENTS CODE
disp('Ingrediants ID#');disp('eggs: 10');disp('avocado: 21');disp('bread slices: 32');disp('peanut butter: 43');disp(' cup of spinich: 54');disp('1/4 tbs of butter: 65');disp('slices of cheese: 76');n = input('how many ingredients do you have? ');%%FOOD INPUT
for k = 1:na(k) = input(sprintf('Type code of Ingrediant #%d: ',k ));A(k) = input(sprintf('Type quantity of Ingrediant #%d: ',k ));endif (n) >= (3)elseif (a(k)) == (10)elseif (a(k)) == (21)elseif (a(k)) ==(32) eggsandwich = ((a(1)*A(1))+(a(2)*A(2))+(a(3)*A(3))) if eggsandwich >= (95) disp('egg avocado sandwich') endend
is this case input is:
a(1) = 10;A(1) = 1;a(2)=21;A(2)= 1;a(3) = 32;A(3) = 2;
eggsandwich = 95
trying to display 'egg avocado sandwich'
Best Answer