

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This lecture is from lab session of Computing in Engineering and Science course. This is basic subject for computer science students. Though it is helpful for everyone who study about programming. Some key words in this lecture are: Programming with Arrays, Input Function, Grouping Data, Mean and Standard Deviation, Finding Max and Min, Exercise, Loop
Typology: Slides
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Larry Caretto Computer Science 106
2
Outline
3
Exercise Eight Goals
4
Exercise Eight Task One
5
Exercise Eight Task One Code
Input Function
7
tests for end of file or exceeding the maximum array bounds
tions that we have discussed previously
8
int n = 0; do { inFile >> xin >> yin; if ( inFile.fail() ) break; x[n] = xin; y[n] = yin; n++; // n = data number } while ( n < MAX_DATA );
Global parameter
9
345 2000 xi < 1000
1000 2 xi ≥ 1000
678 9 xi < 1000
1234 5 xi ≥ 1000
xi yi Group
11
1 2
0
1
0
2
−
=
−
=
N
i
i
N
i
i
−
=
1
0
i
12