Cps 196 week 7

Cps 196 week 7 - Cps 196 week 7 Homework Review Types of...

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

View Full Document Right Arrow Icon
Cps 196 week 7 10/10/11 Homework Review Types of Variables Number of bills or coins – integers value of checks – floating point Chapter 6 The Switch Statement Array: a set of ordered data float score1, score2, score3, score4, score5, …. score10; float score[10] score[0]= 87.4; score[1]=10.3; score[7]=99.9; *when doing 10** score[0] score [9]
Background image of page 1

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

View Full DocumentRight Arrow Icon
int num[15] num[0]=5; printf(“%d \n”, num[9]); num[i]=2; num[i+j]=5; num[j+2]=4; Initialize int x=4; or intx; x=4; int counter [ 5 ]={ 0,3,7,2,4}; type name #of elements , initialize for counter1, counter2, counter3 for value right away assign value later intx[10]; Character Array char letter[5]={‘h’,’e’,’l’,’l’,’o’}; for i=0; i<5; i++) { printf(“%c”, letter[i]); } Array can be multi dimensional [123 int row1[3]; 789] int row2[3]; or
Background image of page 2
int M [3][3] type name # of elements M[i][j] initialize int M[4][5]={{1,2,3,4,5}, {5,7,9,2,2}, {7,8,10,2,7}, {3,4,1,0,7}} 10/12/11 flow chart start ask for # of data ask for value of each data
Background image of page 3

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

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

This note was uploaded on 02/16/2012 for the course CPS 196 taught by Professor Staff during the Spring '08 term at Syracuse.

Page1 / 5

Cps 196 week 7 - Cps 196 week 7 Homework Review Types of...

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

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