• 11-17-2005
jd7joe
whts the code for this program
make a program that displays the percentage of students who passed by getting a d or better and the number who failed by getting an e or f. use Z as the value of the sentinel, making surenot to count the Z as a grade.
• 11-17-2005
Enahs
Quote:

whts the code for this program
That would be the information you type in proper syntax to try and produce a program that does what you said. That is what the code is.
http://cboard.cprogramming.com/annou...ouncementid=39
• 11-17-2005
xhi
Code:

```#include <iostream> using namespace std; int main() {     cout << "make a program that displays the percentage of students who passed by getting a d or better and the number who failed by getting an e or f. use Z as the value of the sentinel, making surenot to count the Z as a grade." << endl;     return 0; }```
yeh i know its been done before, but i couldnt resist. :D
• 11-17-2005
Decrypt
Oh, come on guys, give him a break. I don't have a compiler here at work, but I think this should get you going on the right track.

Code:

```#include <iostream> using namespace std; int main() {     int studentGrade[45] = {89,79,85,32,15,65,82,5,69,32,65,                             78,32,25,73,68,73,79,30,84,46,32,                             31,68,79,17,32,89,79,85,9,82,32,79,                             87,78,20,32,87,79,24,82,15,75,46};     const int passing = 32;     char sentinel = 'd';     double studentTotal = 36;     int passed = 0;     while  (!(1 ||(1 && 0)))     {         cout << "The following students passed: " << endl;}     for (int i=0; i!=45; ++i)         {             if (studentGrade[i] >= passing && sentinel != 'z')             {                 char passed = studentGrade[i];                 cout << passed;             }         }         cin.get();         return 0;     cout << "That means " << passed/studentTotal << "% passed the class." << endl; }```
*edit* corrected the code, should compile now.
• 11-17-2005
xhi

>> whts the code for this program

I dont think he is looking for help, or to get

>> going on the right track.

so I will let it up to you to

>> ... give him a break.

IMO, If you are going to ask someone to do your homework for you, atleast ask in a clever way...

my 2.3 cents
• 11-18-2005
Decrypt
I totally agree, xhi. That's why I wrote the program. (Take a closer look at the code.)
• 11-18-2005
xhi
lol. Gold star for you Decrypt!

[applause]
• 11-18-2005
Harbinger
> whts the code for this program
I'm sure your effort so far will get a well deserved 'F'
• 11-18-2005
Decrypt
Quote:

[applause]
Thank you....I'm here all week. :)