Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could use some help programing this in C please. checkThing - automated quality control 1 V/Don't change the definition of this data type You are

Could use some help programing this in C please.

image text in transcribed

checkThing - automated quality control 1 V/Don't change the definition of this data type You are responsible for implementing automated quality control at the Thing factory. Each Thing that is produced is measured using sensors. You must implement the logic for determining which Things meet their quality control criteria. 2 struct Thing 4 6 8 / Your task is to implement this function int color float weight; float length; The struct Thing data type is defined as follows struct Thing [ int color; float weight; float length; 9 int checkThing(struct Thing the_thing) 10 /TODO: add your code di 12 13 The color field will have one of the values 1, 2, or 3, representing the colors red, green, and blue, respectively. The weight field represents a weight in kilograms. The length field represents a length in centimeters Your task is to implement the checkThing function. It will be passed an instance of struct Thing by value. It should return one of the following int values . A return value of O means that the Thing fails the quality control check . A return value of 1 means that the passes the quality control check . A return value of 2 means that the Thing is likely to explode, so the production line should be shut down The quality control rules are as follows Red things must weigh between 1 and 5 kg and be between 25 and 50 cm in length to pass the quality control check; any red thing that weights more than 10 kg is likely to explode . . Green things must weight between 20 and 30 kg and be between 120 and 175 cm in length to pass the quality control check; any green thing that is shorter than 75 cm is likely to explode . Blue things must weight between 6 and 7 kg and be between 10 and 20 cm in length to pass the quality control check; any blue thing that weighs more than 10 kg and is more than 30 cm in length is likely to explode Author: David Hovemeyer License: Creative Commons Attribution-ShareAlike 3.0

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

More Books

Students also viewed these Databases questions

Question

What did they do? What did they say?

Answered: 1 week ago