Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Statement of problem: A machine is manufacturing ball bearings and, at equal time intervals during a production run, a ball bearing is sampled and its

Statement of problem: A machine is manufacturing ball bearings and, at equal time intervals during a production run, a ball bearing is sampled and its diameter is measured. Each ball bearing should have a diameter of 2.00 mm with a tolerance of +/- 0.040 mm. This program must meet the following criteria: 1. Comment statement with your name in the program & for each line of code that describes what the code does (e.g. //declares the variables X, Y & Z as float)!! 2. No data is read in at the keyboard (entered by user). All data is contained in a text file created by the student (only numerical data is contained in this file). The file should include six (6) bearing diameter sizes. The instructor will ask you to change the file so that all program criteria are determined to be working properly. Create this text file using any text editor such as WordPad or Notepad or Genie; do not use MS Word or Excel. 3. Your program will read individual diameters from the file and keep track of the number of diameters read (e.g. uses a counter). Each diameter will be printed along with the count value (e.g. Bearing #4 is 1.98 mm). 4. Your program will continue to read in the bearing diameters until one of the following occurs: a. A bearing that is too small (<1.96 mm) is found. b. A bearing that is too big (>2.04 mm) is found. c. There are no more bearing diameters in the text file (end of file is found) 5. After step 4 is complete, your program will report all of the following: a. Why it stopped reading in diameter values (see 4 a, 4 b, or 4 c). b. How many bearings were read (total bearings) c. How many were good bearings were measured (note this could be all bearings or all minus 1 depending on why the loop ended). d. For example a message might state: The program has stopped because bearing # 5 was larger than 2.04 mm; 4 good bearings were measured. HINT 1: Dont forget to close your file at the end AND have a statement that looks for the end of the data file.

Using C programming with Geany software.

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

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions