11-05-2010, 03:02 AM
Jameel this is Irfan Doing MCS from Lahore
|
Cs201 Introduction to programing first assignment fall, 2010 idea solution
|
|
11-05-2010, 03:02 AM
Jameel this is Irfan Doing MCS from Lahore
11-05-2010, 04:03 PM
Dear members, my friend pass away and i was there yesterday. i will make this solution today. INSHALLAH it will uploaded as soon as possible.
11-05-2010, 04:04 PM
mc100403316 Wrote:dear expert plzz tel me one more thing that did u have completed ur MCS from VU ?Yes i have completed my mcs.
11-07-2010, 05:10 AM
Sorry for late solution please compile it.
Code: #include <iostream.h>
main()
{
//declaration of variables and intialization
char grade;
int counter = 1; //loop counter
int counterA = 0; // counter for number of grade A
do
{
//prompt user to enter grade
cout<< "Please Enter Grade of student " << counter<< endl;
cin>> grade;
if (grade == 'A' || grade == 'a') //check whether A was entered
counterA = counterA + 1; //increment A counter by 1
counter = counter + 1; //increment loop counter by 1
else if (grade == 'B' || grade == 'b') //check whether B was entered
counter = counter + 1; // increment loop counter by 1
else
cout << "Please Enter 'A' or 'B' grade only" << endl; //handle invalid grades
}
while (counter <= 10);//taking ten grades from user
cout << "Total No. of A Grades = " << counterA << endl; // display results
if (counterA <= 2) //check no of A for declaraing result
cout << "Your class is Poor!" << endl;
else if (counterA > 2 && counterA <= 7)//check no of A for declaraing result
cout << "Your class is Good!" << endl;
else
cout << "Your class is Brilliant!" << endl;
} |
|
« Next Oldest | Next Newest »
|