im stuck on the very last part to put names in order. i was told to use min and max as variables and put names in order from least to greatest. no sorting involved .

#include <iostream>

//

using namespace std;

int main()

{

const int MIN_STUDENTS = 1, MAX_STUDENTS = 25;

int Students;

string name;

cout << "How many students are in your class?" ;

cin >> Students;

while (Students < MIN_STUDENTS || Students > MAX_STUDENTS)

{

cout << "you should have at least: " << MIN_STUDENTS

<< "but no more than: " << MAX_STUDENTS << " per class. \n";

cout << "How many students are in your class?" ;

cin >> Students;

}

int count;

for(count = 0; count < Students; count++)

{

cout <<"Enter the students name: ";

cin >> name;

}

system("PAUSE");

return 0;

}

#include <iostream>

//

using namespace std;

int main()

{

const int MIN_STUDENTS = 1, MAX_STUDENTS = 25;

int Students;

string name;

cout << "How many students are in your class?" ;

cin >> Students;

while (Students < MIN_STUDENTS || Students > MAX_STUDENTS)

{

cout << "you should have at least: " << MIN_STUDENTS

<< "but no more than: " << MAX_STUDENTS << " per class. \n";

cout << "How many students are in your class?" ;

cin >> Students;

}

int count;

for(count = 0; count < Students; count++)

{

cout <<"Enter the students name: ";

cin >> name;

}

system("PAUSE");

return 0;

}

Last edited on

Topic archived. No new replies allowed.