Assume that the variables gpa , deansList and studentName , have been declared and initialized . Write a statement that both adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.
LANGUAGE: C++
CHALLENGE:
Assume that the variables gpa , deansList and studentName , have been declared and initialized . Write a statement that both adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.
SOLUTION:
if(gpa > 3.5){ deansList++; cout << studentName; }