/*--- Demo for Week 9 - Lecture 2 - Clicker Question 1 compile using: g++ clicker1.cpp -o clicker1 run using: ./clicker1 by: Sharon Tuttle last modified: 2026-10-21 ---*/ #include <cstdlib> #include <iostream> #include <string> #include <cmath> using namespace std; /*=== signature: grade_in_range: double -> bool purpose: expects a grade and returns whether or not it is in [0, 100] tests: grade_in_range(-10) == false grade_in_range(0) == true grade_in_range(50) == true grade_in_range(100) == true grade_in_range(150) == false ===*/ bool grade_in_range(double num_grade) { return (0 <= num_grade <= 100); //return (num_grade >= 0 and <= 100); //return (num_grade >= 0) or (num_grade <= 100); //return (0 <= num_grade) and (num_grade <= 100); } /*--- show the value of the compound expression grade_in_range(500) ---*/ int main() { cout << boolalpha; const string DEMO_CALL = "grade_in_range(500):"; cout << ("Value of " + DEMO_CALL) << endl; cout << grade_in_range(500) << endl; return EXIT_SUCCESS; }