Answered step by step
Verified Expert Solution
Link Copied!

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 image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

Write an article on "Proteins"

Answered: 1 week ago