Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int length, data1;
  2. string data2;
  3.  
  4. //arrays start at Zero, Length cannot be more then size, because that is out of the array, add to length each loop
  5. for(length = 0; length < SIZE; length++)
  6. {
  7.     cout << "ask for data";
  8.     cin >> give data
  9.    
  10.     //validate your data here
  11.    
  12.     birdType[length] = data
  13.  
  14.     cout << "ask for data2";
  15.     cin >> give data2
  16.    
  17.     //validate your data2 here
  18.    
  19.     numberOfBirdsSeen[length] = data2
  20. }
  21.  
  22. //to Print out the data instead of SIZE we use Length. this makes sure we only print Valid data.
  23. //ctr is just counter name, it can be anything
  24. for(ctr = 0; ctr < length; ctr++)
  25. {
  26.     //print out your data like this, it can be to Cout or Fout.
  27.     // use setw for formating, so you can copy her presentation
  28.     //your completed copy should be to fout.
  29.     cout << birdType[length];
  30.     cout << numberOfBirdsSeen[length];
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement