Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The answer to this question should provide: 1) The source code to your program (also insert the source code into the assignment file). 2) The
The answer to this question should provide: 1) The source code to your program (also insert the source code into the assignment file). 2) The output showing the results of all the test cases; insert the output into the assignment file. This needs to be in basic c programming format.
You must develop a program that calculates the weight of a number of flat washers with the following d: The given dimension of the washer is given by its thickness (x), the external diameter (d:) and the hole diameter (d). Thus the area of the washer is given by a (d, /2) -d2) The volume, v, of the washer is given by v-xa The weight, w, of the washer is given by wd where d is the density of washer's material. From these equations, the weight w. of n washers is given by Develop a program that requests from the user the following data The number n of washers, The density of the washer's material, in kg/cm * The thickness x of the washer, in centimeters (cm) The extermal diameter, d, of the washer in em, The diameter of the hole, di, of the washer in em . For the main function sav Calls the function totalweight to compute weight of the n flat washers. Display results to the user in a message (see the following example) that includes data input by the user and the weight of the washers. Format the output values to display at most the number of digits in the fractional part of the real values shown the message example. The washer characteristics are o o Density: 0.00260 kg/cm 3 Thickness: 0.030 cm External diameter: 0.500 cm Diameter of the hole: 0.230 cm The weight of 1 washers is 1.21e-005 kg For the function totalneight o Define parameters to receive the data input by the user o Define local variable for storing the total weight, w o Note that the math header file, math.h, provides the symbolic constant M PI for the value of . o Instead of using a single instruction to compute the force value, use a number of instructions to "accumulate" values into the variable wu as follows. Note that these are not true mathematical equations but show how w as a compu intermediate values during the computation. uter variable can accumulate Assigns to w, the value of Assigns to w, the value of nd -dj) nxd di-di w,4 Assigns to w, the value ofStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started