Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(40 points) Write a complete C program that does the following exactly once: Uses a user validation loop to prompt its user to enter a

image text in transcribed
(40 points) Write a complete C program that does the following exactly once: Uses a user validation loop to prompt its user to enter a sensor reading that must be an Integer in the range (0,4) into a variable named sensori of type int. . Uses a user validation loop to prompt its user to enter a sensor reading that must be an Integer in the range (0, 41) into a variable named sensor2 of type int. Computes and prints (to the screen) the average of the two sensor values entered Displays exactly one of the following messages (based on the given criteria): - if the average of the two sensor values is equal to 0, print (to the screen): "Are you sure this thing is turned on?" - if the average of the two sensor values is in the range (0, 3.5), print to the screen): All is well" - if the average of the two sensor values is in the range (3.5, 4. print to the screen) "That's a problem!" Sample run(s): run 1 - - ------- -- Enter sensori's value: -10 Enter sensor's value: 8 Enter sensori's value: 0 Enter sensor2's value: -1 Enter sensor2's value: 0 The average of the two sensors was 0.0 Are you sure this thing is turned on? run 1 - run 2 --- Enter sensori's value: 3 Enter sensor2's value: 2 The average of the two sensors was 2.5 All is well run 2 --- run 3 ---------- Enter sensori's value: 4 Enter sensor2's value: 3 The average of the two sensors was 3.5 That's a problem! run 3

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

What are some ways to build relationships within the core team?

Answered: 1 week ago