Public paste
c++
By: Jazy84 | Date: Nov 10 2006 20:57 | Format: C++ | Expires: never | Size: 862 B | Hits: 1426

  1. #include <iostream>
  2. #include <string>
  3.  
  4.  
  5. using namespace std;
  6.  
  7.  
  8. void get(string[], int[],int);
  9. void print(string[],int[],int);
  10.  
  11. int main(string argv[],int num) {
  12.  
  13.         cout<<"Enter number of grades: ";
  14.         cin>>num;
  15.         cout<<"nYou have said there are "<<num<<" students/gradesn";
  16.  
  17. string name[num];
  18. int grade[num];
  19.  
  20. for (int i=0;i<num;i++) {
  21.         get(name,grade,i);
  22. }
  23. cout<<"nnn"; //just a bit of empty lines for output purposes.
  24.  
  25. cout<<"NamettGraden";
  26. for (int j=0;j<num;j++) {
  27.         print(name,grade,j);
  28. }
  29. cout<<"nThank you for using this system!n";
  30.  
  31. return 0;
  32. }
  33.  
  34. void get(string name[],int grade[],int i) {
  35.         cout<<"Enter the Name of the student: ";
  36.         cin>>name[i];
  37.         cout<<"Enter the students grade: ";
  38.         cin>>grade[i];
  39.         cout<<endl;
  40. }
  41.  
  42. void print(string name[],int grade[], int i) {
  43.         cout<<name[i]<<"tt"<<grade[i]<<endl;
  44.  
  45. }
  46.