Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following problem. Suppose that calculators do not exist, but you h

ID: 1717984 • Letter: C

Question

Consider the following problem. Suppose that calculators do not exist, but you have a copy of matlab that survived World war 3. Due to radiation poisoning, everyone has forgotten how to add, subtract, multiply, and divide by hand. A critical engineering calculation requires a long division problem be solved. You must divide 14247.2 by 13.5 and obtain an answer that is accurate to four sig figs.
Create a MATLAB function to perform this calculation WITHOUT the use of multiplication and division. You may a FOR loop or WHILE loop, and you may use addition and subtraction. Type your solution into MATLAB, obtain the result and then check it with a calculator to make certain you are within the required error limit of four sig figs of precision.

ENGR 2050 Lecture Homework #2 Due Monday Feb. 8 Lecturer material has now covered the basic structure and use of for and whille loops in Matlab. Consider the following problem. Suppose that calculators do not exist, but you have a copy of Matlab that survived World War IlI. Due to radiation poisoning, everyone has forgotten how to add, subtract, multiply and divide by hand. A critical engineering calculation requires a long division problem be solved. You must divide 14247.2 by 13.5 and obtain an answer that is accurate to four significant digits. Create a Matlab function to perform this calculation WITHOUT the use of multiplication and division. You may use a FOR loop or WHILE loop, and you may use addition and subtraction. Type your solution into Matlab, obtain the result and then check it with a calculator to make certain you are within the required error limit of four significant digits of precision. Write up your Matlab solution in standard form following the template handout you have been given, and turn it in on Monday. You do not need to provide the answer from Matlab. Just turn in the Matlab code in class on Monday. This is a 50 point assignment weighted one half of a regular lab report, so do a good job. It is an opportunity to fix some grades. You may use any resource and are encouraged to work in groups. Just turn in your own typed copy of the code WITH YOUR OWN COMMENTS explaining how the code actually works. Follow the template handout.

Explanation / Answer

Matlab Code

rem = 14247.2;
div = 13.5;
i = 0;
while rem > div
    rem = rem - div;
    i = i+1;
end
answer = i;
disp(answer)

Output

1055