{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Exam 2 Sample Questions

Exam 2 Sample Questions - Sample Exam 2 Questions Problem#1...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Sample Exam 2 Questions Problem #1 Based on the current balance in a money market account at a local Lafayette bank, two different bonus levels are applied to a base interest rate. The following MATLAB code applies after the variable current_balance has been assigned a value: i_rate = 0.7 if (current_balance >= 7500) & (current_balance < 25000) i_rate = i_rate + 0.65 elseif current_balance >= 25000 i_rate = i_rate + 1.3 end fprintf( ' Interest rate = %3.2f percent \n ' ,i_rate) a) Determine exactly what will be printed to the MATLAB command window for current_balance values of: i) 3,000 ii) 40,000 iii) 20,000 b) Construct a flowchart from which the above MATLAB code could have been developed. Remember that no MATLAB code should appear in the flowchart. Problem #2 The following MATLAB code was written in a script file: clear all n=8; if n>=10 disp('Range 3') elseif n>=5 disp('Range 2') elseif n>=0 disp('Range 1') end a . (4 points) When the MATLAB script is executed, Range 2 is displayed. Why doesn’t Range 1 also display? b . (4 points) Since someone reading the program could find it confusing that Range 1 does not display, how should the program be modified to avoid confusion?
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Problem #3 A phase diagram for Carbon and Platinum is shown below (Graphite is a particular phase of Carbon). After making a flowchart, a novice materials engineer knows enough to write the code below, but you need to finish it. All phase boundaries in the diagram are linear and the endpoints of the upper phase boundary line are shown. a. Line 1 defines the equation of the line for the boundary between the “L” and “L + Graphite” regions. Compute the slope and intercept for this line and write them on the answer sheet. b. Line 2 shows the condition to determine if the phase is “Pt + Graphite”. The engineer may have forgotten to include conditions in lines 4, 6 and 8. Assuming your equation in part “a” (above) is correct: Determine if conditions are needed (check the appropriate box on the answer sheet). If conditions are needed, write the correct condition on the answer sheet. 1. phase_line =____*massC + _____; % equation for phase boundary 2. if Temperature < 1700 % Solid mixture Phase 3. phase = 'Pt + Graphite'; 4. elseif ______________________ % Eutectic line 5. phase = 'Pt, Graphite, and Liquid'; 6. elseif ______________________ % Liquid Phase 7. phase = 'Liquid'; 8. else ______________________ % Liquid + graphite Phase 9. phase = 'Liquid + Graphite'; 10. end L L + Graphite Pt + Graphite Eutectic line
Image of page 2
3 Problem #4 I am forming teams and workgroups for an engineering project based on rules that match team members schedule and staffing needs. I have four independent conditions I want to test, so each can be analyzed without knowledge of the others. The first letter of the person’s name is used as the variable. In part a
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern