Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Resources Status ti... Overview Plans Tollow-up , Lastly, one by one the viscosity for each bottle will be given as double values. The program will

image text in transcribed
image text in transcribed
Resources Status ti... Overview Plans Tollow-up , Lastly, one by one the viscosity for each bottle will be given as double values. The program will check the viscosity value of each bottle using a function (isViscosityAcceptable that gets necessary items as parameters and returns a bool value. The main function will prin out the index of the "valid items" as int values. An item that is WITHIN the tolerance boundar is a "valid item". The tolerance boundary can be calculated with the following formulas; Lower Boundary = idealvis - (idealvis * 2.2*tolLevel) Upper Boundary = idealvis + (idealvis * 1.2*tolLevel) NOTE: The viscosity acceptability check MUST be done in the function. And printing the result to the screen MUST be done in the main function. NOTE: The index number of the first bottle is 1, NOTO. 5 10 0.10 Input 5 9.8 9.5 11.2 22.1 89.5 0.12 6 105 0.20 99.9 10.2 8.2 12 11 132 98 106 205 4 30 7 9.5 Output 234 123478 23 Answer assignment Tollow-up Participants Assignment Write a program that checks the viscosity of shampoo bottles coming from a production line using a function. For each bottle, the viscosity value must be CLOSE to its ideal value. However, due to manufacturing problems viscosity varies from bottle to bottle. First, the program will read the number of bottle (numBottle) as an int. Then, the ideal viscosity value will be given (idealvis) as a double followed by the tolerance level (tollevel) as a double. Lastly, one by one the viscosity for each bottle will be given as double values. The program will check the viscosity value of each bottle using a function (isViscosityAcceptable) that gets necessary items as parameters and returns a bool value. The main function will print out the index of the "valid items" as int values. An item that is WITHIN the tolerance boundary is a "valid item" The tolerance boundary can be calculated with the following formulas; Lower Boundary = idealvis - (idealvis * 2.2*tolLevel) Upper Boundary = idealvis + (idealvis * 1.2*tolLevel) NOTE: The viscosity acceptability check MUST be done in the function. And printing the result to the screen MUST be done in the main function NOTE: The index number of the first bottle is 1, NOTO. 5 10 0.10 89.5 0.12 6 105 0.20

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

What is a verb?

Answered: 1 week ago