llapioNoteSet07

llapioNoteSet07 - Principles of Programming I Note Set #7 1...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Principles of Programming I Note Set #7
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Let’s Review First Array subscripts begin at… Size Declarators Array initialization lists Implicit Sizing and Partial Initialization Passing arrays to functions Displaying array contents
Background image of page 2
3 Semester Overview Functions Character File I/O Arrays Pointers and Dynamic Memory Allocation Structures/Records Binary File I/O
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Overview Parallel Arrays Copying array contents
Background image of page 4
5 Parallel Arrays Parallel Arrays Two separate arrays whose contents are related by the subscripts int hours[5]; float payRate[5];
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Parallel Arrays int main() { int hours[5]; float payRate[5]; cout<<“Enter hours worked ” <<“by 5 employees and their ” <<“hourly rates.\n”;
Background image of page 6
7 Parallel Arrays for (int i=0; i < 5; i++) { cout<<“Hours worked by emp# “ <<(i+1)<<“: “; cin>>hours[i]; cout<<“Enter hourly pay for emp# “ <<(i+1) <<“: “; cin>>payRate[i]; } 10 15 20 40 40 9.75 8.62 10.50 18.75 15.65 payRate hours [0] [1] [2] [3] [4]
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

llapioNoteSet07 - Principles of Programming I Note Set #7 1...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online