Ask Question
22 April, 01:18

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.

+3
Answers (1)
  1. 22 April, 04:10
    0
    Following are the statement which is given below:

    if (gpa > 3.5) / / check the condition if gpa exceeds 3.5.

    {

    deansList++; / / increment of 1 in the deansList variable

    cout << studentName; / / display the studentName,

    }

    Explanation:

    The description of the statement

    In the if statement we check the condition of "gpa". if "gpa" is greater then 3.5 then it executed the statement inside the if block otherwise nothing will be executed. if control moves to the if part it adds to 1 to the deansList. Finally, display the value of studentName.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assume that the variables gpa, deansList and studentName, have been declared and initialized. Write a statement that both adds 1 to ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers