Consider a string defined as this is a test what

This preview shows page 14 - 17 out of 24 pages.

Consider a string defined as ['This' 'is' 'a' 'test'] . What is/are the indices of i 7 Responses 3 51 Responses 3 & 5 19 Responses 3 & 6 6 Responses 2 15 Responses 1 & 2 Responses 98 % Students All Correct 52 | Gateway | Copyright 2008-2009 IST Lahore University of Management Sciences. All rights reserved. Portions of LMS are copyrighted by sakai foundation and other parties as described in the Acknowledgments screen. Learning Management System - RELEASE - Sakai 2.5.2 - Server lms2.lums.edu.pk
Image of page 14

Subscribe to view the full document.

10/16/12 Learning Management System : 1201 Computational Problem Sol (CS 100 Sec:1) : Tests & Quizzes 1/3 lms.lums.edu.pk/portal/site/…/20461864-bca6-4164-bf42-2e76b3f407e4 Tests & Quizzes Home Syllabus Schedule Announcements Resources Assignments Gradebook Roster Site Info Evaluation System Forums Mailtool Polls Forms Wizards Help User s pr esent: 16100110 Abubakar Siddique 16100200 Adil Ahmad 16100112 Bilal Ayaz Butt 16100063 Haneya Logout Statistics : Quiz - Lab 6 (Tuesday) Submission Status | Total Scores | Questions | Statistics | Export View : All Submissions Total Score Number of Points Number of Students 0 - 1 47 >1 - 2 34 >2 - 3 17 >3 - 4 12 >4 - 5 1 Submissions 111 Total Score Possible 5 Mean 1.85 Median 2 Mode 1, 2 Range 0 - 5 Quartile 1 1 Quartile 3 3 Standard Deviation 1.19 Part 1, Question 1 (Numeric Response) >> x = 0; >> while x <90 x = x +10; if x~= 5 x = x + 1; end end The final value of x will be ____. 15 Responses 99 Responses 111 % Students All Correct 13 Part 1, Question 2 (Fill in the Blank) >> x = 25; >> while x > 0 disp ('Hello'); x = 2*x - 30; end The program will print the word 'Hello' ____ times. 64 Responses 3 Responses 111 % Students All Correct 57 Tests & Quizzes My Workspace 1201 Computational Problem Sol (CS 100 Sec:1) 1201 Computer Graphics (CS 452 Sec:1) PHD_QE Fall 2012 1102 Multiview Geometry in Computer (CMPE
Image of page 15
% Students All Correct 57 Part 1, Question 3 (Multiple Choice (single correct)) >> x = [2 4 1 8 2 8 1]; >> for n = 1:7 if x(n) < 5 disp(n) else break end end This program will display numbers , one number to a line. What sequence of numbers will be displayed? 35 Responses 1,2,3 58 Responses 2,4,1 3 Responses 2,4,1,8,2 11 Responses 2,4,1,8 3 Responses 1,2,3,4 Responses 110 % Students All Correct 31 Part 1, Question 4 (Multiple Choice (single correct)) Which of the following will randomly generate numbers 30, 40, 50 and 60? 18 Responses x = 20 + 10*floor(rand + 1) 11 Responses x = 20 + floor(40*rand) + 1 45 Responses x = 10*(floor(4*rand) + 1) + 20 3 Responses x = floor(6*rand) + 20 34 Responses x = 10*floor(4*rand) + 20 Responses 111 % Students All Correct 40 Part 1, Question 5 (Multiple Choice (single correct)) In the following 10 lines of code, a grade is dispalyed based on the value stored in x. Assume that only integer values can be stored in x. An 'A' grade should be displayed when the value of x is 90 or above, 'B' for x between 80 and 89 and so on ..... 1. if x > 90 2. disp('Your Grade is A'); 3. elseif x >= 80 4. disp('Your Grade is B'); 5. elseif x >= 60 6. disp('Your Grade is D'); 7. elseif x >= 70 8. disp('Your Grade is C'); 9. else 10. disp('Your Grade is F'); 11. end This code can be logically fixed by:
Image of page 16

Subscribe to view the full document.

10/16/12 Learning Management System : 1201 Computational Problem Sol (CS 100 Sec:1) : Tests & Quizzes 3/3 lms.lums.edu.pk/portal/site/…/20461864-bca6-4164-bf42-2e76b3f407e4 17 Responses making no change (it is fine as it is).
Image of page 17
You've reached the end of this preview.
  • Spring '13
  • SaraScott
  • Learning management system, Montreal Metro, Management Sciences, Sakai Project, Sakai Foundation, Lear ning Management

{[ 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