### Help a new guy out!

Write your question here.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130`` `````` #include #include #include using namespace std; string names [12]; int weights [12]; void readInNames (int size) { ifstream fin ("namesProject4.txt"); for (int i =0; i < size; i++) { fin >> names [i]; } } void readInWeights (int size) { ifstream fin ("weightsProject4.txt"); for (int i =0; i < size; i++) { fin >> weights [i]; } } void print (int size) { for (int i=0; i 0 && names[position-1] > key) { names[position] = names[position-1]; weights[position] = weights[position-1]; position--; } names[position] = key; weights [position] = key1; } } int main () { int a, b, c, size = 12; readInNames(size); readInWeights(size); cout << "List of People" << endl; print (size); cout << endl; cout << "People that can get on the elevator without sorting." << endl; a = howmany(); print (a); cout << endl; cout << "List of people while being sorted by their weight." << endl; descendingOrder (size); print (size); cout << endl; cout << "People that can get on the elevator that are sorted by weight." << endl; b = howmany(); print (b); cout << endl; cout << "List of people while being sorted by their name." << endl; ascendingNames (size); print (size); cout<< endl; cout << "People that can get on the elevator that are sorted by their names." << endl; c = howmany(); print (c); cout << endl; if (a > b && a > c) cout << "Without sorting, more people can get on the elevator with a total of " << a << " people." << endl; else if (b > a && b > c) cout << "While sorting by weights, more people can get on the elevator with a total of " << b << " people." << endl; else if (c > a && c > b) cout << "While sorting alphabetically, more people can get on the elevator with a total of " << c << " people." << endl; cout << endl; cout << "This was programmed by Christopher Weiss" << endl;``````

Hey guys i cant see to get this code to show up on my output screen any help?
Hello cweiss1,

 i cant see to get this code to show up on my output screen

Exactly what do you mean, the entire source code or just the "cout"statements?

The entire source code will not output to the screen when the program runs just the parts that start with"cout".

Be more specific about what is or is not showing up on the screen. Also state what you expect to see.

Line 130. Not everyone is willing to put their name. It is your choice. Also after line 130 you are missing a "return 0;" and the closing brace of main.

Hope that helps,

Andy
A common issue is that on windows the program executes so fast the output window opens and closes too fast to see it, which can be cured with a dummy cin statement (read something you don't actually need) or the dubious system("pause") line.

Registered users can post here. Sign in or register to post.