Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C QUESTION I. (16 points) Wrie a program that reads an integer from the user and cheds bew masy of the criteria below it mscts.
C QUESTION I. (16 points) Wrie a program that reads an integer from the user and cheds bew masy of the criteria below it mscts. Your output should be similar to the samples below, Sart by deciding whather you should ase if-or ifelse stalements. - The integer is positive - The integer is a multiple of 2 - The integer is a muliple of 3 Bnter integeri 4 The integer 4 in positive. The integer 4 is a multiple of 2 . Bater integer: 11 The integer 11 doesn't meet any criteria. Hint: You can use a flag variable, which is a regular variable that is set to cither is 4 or 1 to detect the case in which no criteria are met. QUESTION 2. (10 points) Write a program that seads a pollution measurement (integer) from the seer and prints the corresposiding pollution level. The pollution levels are shown below. Stant by deciding whether it's beticr to use if- or ifelse statements. Your program should minimine the number of congurisens like we did in class. For this question, do not use switch-casc, so you can practice if-lif-clse statements
C
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started