Cps 196 week 7

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

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

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]

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

View Full Document
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
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 show chart done variables int, float, char array int x [10 type name #ofelements number of data wil be integer named “numData” data will be stored in an array nane date if type int!

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern