ICA 172 Without running these code segments in MATLAB what w
     ICA 17-2 Without running these code segments in MATLAB, what will be the value stored in the specified variable after executing each program? (a) What is stored in Dogs? clear clc Greyhounds 30; G-Cost =250; Dalmations = 10; D. Cost = 150; Dogs =Greyhounds * G-Cost + Dalmations * D. Cost; (b) What is stored in W? clear c1c x = 2; Y=4; z = 2; W = (Y + Z/X + Z^1/2)  
  
  Solution
ICA 17-2
(a) BODMAS rule is followed. In this case first multiplication then addition, hence,
Dogs = 30*250 + 10*150 = 7500 + 1500 = 9000
(b) BODMAS rule is followed, first power-off, then division and then addition,
W = (4 + 2/2 +2^1/2) = (4 +1 +2/2) = (4 + 1 + 1) = 6
ICA 17-3
(a) BODMAS rule is followed, first power-off then addition,
X = 0^5 + 5^0 = 0 + 1 = 1
(b) First matlab function is calculated then as per BODMAS, division, multiplication and then addition. Matlab function \"max()\", gives the maximum of the numbers within the brackets.
Ramones = 1*2 + 2/2 + max([3, 4]) = 2 + 1 + 4 = 7
Hope this helps. Let me know if there are any questions.
Cheers!

