final - // If you don't have a 90+ average, you still have...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// final.cpp / #include <iostream.h> # int main() { bool exempt_from_final; double my_average; int my_days_absent; exempt_from_final = false; cout << "What is your course grade average? "; cin >> my_average; cout << "How many days were you absent from class? "; cin >> my_days_absent; if (my_average >= 90) { // If your average is 90 or better if (my_days_absent <= 3) // and you have missed three days { exempt_from_final = true; } // or less, you are exempt. } else
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // If you don't have a 90+ average, you still have a chance. { if (my_average &gt;= 80) { // If your average is 80 or better if (my_days_absent &lt;= 1) // and you have missed one day or { exempt_from_final = true; } // less, you are exempt. } } // Notify student of the decision. if (exempt_from_final) { cout &lt;&lt; &quot;You are exempt from the final exam.\n&quot;; } else { cout &lt;&lt; &quot;You must take the final exam for the course.\n&quot;; } return 0; }...
View Full Document

Ask a homework question - tutors are online