Ask Question
11 February, 17:31

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. 11 February, 18:57
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers