Documente Academic
Documente Profesional
Documente Cultură
com/
Best Website To Help VU Students
Assignment No. 1 Total Marks: 20
Semester: Fall 2010
CS201: Introduction to Programming Due Date: 05th
November, 2010
Instructions:
Please read the following instructions carefully before submitting your
assignment:
It should be clear that your assignment will not get any credit if:
Note: You have to upload only .cpp file. Assignment in any other format
(extension) will not be accepted. If you will submit code any other file
format like .doc or .txt etc. you will get zero marks.
Objective
The objective of this assignment is to provide hands on experience of using
Guidelines
Code should be properly aligned and well commented.
Follow C/C++ rules while writing variables names, function names
etc.
Use only Dev-C++ IDE for this assignment.
Assignment
You are required to write a program which should take input from user in the
form of characters A or B. Based upon user’s input you should calculate no.
of A grades. You should use while loop or do/while loop for taking input and
http://vujannat.ning.com/
Best Website To Help VU Students
http://vujannat.ning.com/
Best Website To Help VU Students
if / else condition for making decisions.
Detailed Description:
http://vujannat.ning.com/
Best Website To Help VU Students
http://vujannat.ning.com/
Best Website To Help VU Students
C
Deadline:
Your Assignment solution must be uploaded/submitted on or before November
05, 2010
#include<conio.h>
#include<iostream.h>
int main()
{
int countA=0,countB=0,counTotal=1;
char grade;
do
{
cout<<"Please Enter Grade of student "<<counTotal<<":"<<endl;
cin>>grade;
if (grade=='A')
{
countA++;
}
else if(grade=='B')
{
countB++;
}
else
{
cout<<"Please Enter Grade ('A' OR 'B' ):"<<endl;
http://vujannat.ning.com/
Best Website To Help VU Students
http://vujannat.ning.com/
Best Website To Help VU Students
continue;
}
counTotal++;
getch();
return 0;
http://vujannat.ning.com/
Best Website To Help VU Students