c++
By: Jazy84 | Date: Nov 10 2006 20:57 | Format: C++ | Expires: never | Size: 862 B | Hits: 1496
- #include <iostream>
- #include <string>
- using namespace std;
- void get(string[], int[],int);
- void print(string[],int[],int);
- int main(string argv[],int num) {
- cout<<"Enter number of grades: ";
- cin>>num;
- cout<<"nYou have said there are "<<num<<" students/gradesn";
- string name[num];
- int grade[num];
- for (int i=0;i<num;i++) {
- get(name,grade,i);
- }
- cout<<"nnn"; //just a bit of empty lines for output purposes.
- cout<<"NamettGraden";
- for (int j=0;j<num;j++) {
- print(name,grade,j);
- }
- cout<<"nThank you for using this system!n";
- return 0;
- }
- void get(string name[],int grade[],int i) {
- cout<<"Enter the Name of the student: ";
- cin>>name[i];
- cout<<"Enter the students grade: ";
- cin>>grade[i];
- cout<<endl;
- }
- void print(string name[],int grade[], int i) {
- cout<<name[i]<<"tt"<<grade[i]<<endl;
- }
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago