Please create a Desk Check for the following programs. There should be three tables, one for each
Question:
Please create a Desk Check for the following programs. There should be three tables, one for each of the
three problems. Start by annotating the code with line numbers. Each will be turned in by hand at the
beginning of class. Please print this sheet out and put your name on it:
Problem 1: Convert grade
{
int numGrade = 70;
char letter = 'F';
if (numGrade >= 80)
{
if (numGrade >= 90)
letter = 'A';
else
letter = 'B';
}
else
{
if (numGrade >= 70)
letter = 'C';
else
letter = 'D';
}
}
Problem 2: Prompt
The user input is 2, 0, 10 in the following code:
{
int numCookies = 0;
while (numCookies < 4)
{
cout << "Daddy, how many cookies "
"can I have? ";
cin >> numCookies;
}
cout << "Thank you daddie!\n";
}
Problem 3: Counter
{
int iUp = 0;
int iDown = 10;
while (iUp < iDown)
{
cout << iUp << '\t'
<< iDown << endl;
iUp++;
iDown--;
}
}
College Mathematics for Business Economics Life Sciences and Social Sciences
ISBN: 978-0321614001
12th edition
Authors: Raymond A. Barnett, Michael R. Ziegler, Karl E. Byleen