Question: 10. Given the following: printf( Enter your age in years: ); scanf( %d, &age_in_years ); int is_voting_age = ( age_in_years >= 18 ); int
10. Given the following: printf( "Enter your age in years: " ); scanf( "%d", &age_in_years ); int is_voting_age = ( age_in_years >= 18 ); int is_drinking_age = ( age_in_years >= 21 ); int can_be_president = ( age_in_years >= 35 ); int is_senior_citizen = ( age_in_years >= 65 ); a) When the age entered is 33, what are the values of the variables above? b) When the age entered is 12, what are the values of the variables above? c) Write an IF statement in a function to print 'Yes' for each value above that is true.
11. What is pseudocode? Explain where you might use it.
12. Write an expression to test for each of the following relationships: a. age is from 18 to 21, inclusive. b. water_temperature is less 92.7 but greater than 76.5. c. year is divisible by 4. d. speed is not greater than 55. e. x is greater than y but not larger than c. f. w is not equal to 3, 6, or 10, and less than maximum.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
