EngE_1114_HW10 - 12:20 M | 1 EngE 1114 HW10 | 25 February...

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

View Full Document Right Arrow Icon
1) Given: grades Required: Flowchart, MatLab code, and sample run Relationships: Solution: % This function will return the number of grades inputted, the average  of % those grades, and the standard deviation of those grades, when  provided % with the number value of those grades. Call statement: grade_avg sum_grade=0; N=0; sum = 0; again=input( '\n Please enter a 1 if a grade is to be entered, 0 if  there are no grades:  ' ); while  again~=0         N=N+1;     grade(N)=input( '\n Please enter the grade:  ' );     sum_grade = sum_grade + grade(N);     again=input( '\n Please enter the 1 if a grade is to be entered, 0  if there are no grades:  ' ); end if  sum_grade == 0         fprintf ( 'Error. You did not enter any grades.\n' ) else     avg = sum_grade/N;      for  z = 1:1:N       l = (grade(z) - avg)^2;       sum = sum + l;       s = (sum./N)^(1/2);      end fprintf ( '\nThere were %.0f grades entered. The average of those grades  is %f. The' ,N,avg) fprintf ( ' standard deviation is %f.\n' ,s) end 12:20 M | EngE 1114 HW10 | 25 February, 2006 | Konzik, Kit | /
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
>> grade_avg Please enter a 1 if a grade is to be entered, 0 if there are no grades: 1 Please enter the grade: 89
Image of page 2
Image of page 3
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