Explore BrainMass
Share

Compute The Diameters of Rod in C Language

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

A program to compute the diameter in centimeters of steel rod, and aluminum rod, and a copper rod, which can withstand a particular compression load. The allowable compression stress of steel, aluminum, and copper is 25,000 lbs/m², 15,000 lbs/m², and 20,000 lbs/m², respectively.

Area of rod = compression load
________________________
Allowable compression stress

Area = π r^2 where diameter d= 2r

Input the compression load. Print the type of material, load, allowable stress, and diameter. Used formatted output with field with specifications that align output.

© BrainMass Inc. brainmass.com October 25, 2018, 8:26 am ad1c9bdddf
https://brainmass.com/computer-science/c/compute-the-diameters-of-rod-in-c-language-540419

Solution Preview

Hi, this is my c program. I run the code in turbo c++. Attached is my output. Hope it helps.

#include <stdio.h>
#include <math.h>

void main()
{
double comprLoad,comprStress; /*to store load,stress of rod */
double d,area; /* for diameter and area of the rod */
char type[20]; /* rod type */

/* ...

Solution Summary

The solution gives a complete C program on computing the diameters of steel rod, aluminum rod, and copper rod using the given formula. The output of the program is also provided for reference.

$2.19
See Also This Related BrainMass Solution

Frequency Distribution Table, Stem and Leaf Plot, Histogram, Z-Score and other Problems

[Please see attachment for data and charts]

1. Identify each number as either continuous or discrete.

a. The average speed of cars passing a speed trap on the Maine Turnpike between 3 PM and 6 PM on a given Monday.
b. A census taker wants to know the number of Maine families with preteens.
c. The temperature of the ocean at various depths.

2. For each of the following variables, indicate whether it is qualitative or quantitative.

a. The admitting diagnosis of patients admitted to a mental health clinic.
b. The weights of babies born in a hospital during a year.
c. The class rank of high school seniors at the local high school.
d. The religion of the sample subjects.

3. Identify each study as either experimental or observational.

a. A sample of fish is taken from the Androscoggin River, in Maine, to measure the level of mercury in the fish.
b. A research scientist gives a weight loss drug to a group of 500 patients and a placebo to another 500 patients to determine if the weight loss drug has an effect on the patients.

4. In response to a poll on a Dateline NBC program about wildlife conservation, 1276 of 1450 callers said they would be willing to spend more money on imported fossil fuels in order to eliminate the possibility of oil drilling in national parks set aside as wildlife preserves. NBC followed with the announcement that 88% of Americans are willing to spend money to protect wildlife preserves. Do you think that the group of people who responded is likely to be representative of all Americans? Explain your answer.

5. Construct a frequency table with 4 classes for the following data on the charge for monthly long distance phone bills for the last year: $17.06, $20.96, $25.97, $26.41, $22.02, $27.34, $18.67, $24.88, $24.07, $25.35, $23.39, $20.60.

6. Find the original data from the stem-and-leaf plot.

7. The winners of the NCAA wrestling championships for the years 1968-1997 are
given in the table below.
a. Compute relative frequencies for each class and fill in the appropriate column
of the table. Round all relative frequencies to 3 decimal places.
b. Draw the relative frequency histogram for the above table.

8. Consider the following relative frequency histogram displaying the number of cars
sold per week last year for a given sales rep, Ronnie, at Emerson Toyota.
Given that there are 52 weeks in a year, approximately how many times did Ronnie
sell 2 cars per week? Round your answer to the nearest whole week.

9. The average retail price for bananas in 1994 was 46.0 cents per pound, as reported
by the U.S. Department of Agriculture. A recent random sample of 8 supermarkets
gave the following prices for bananas in cents per pound.
a. Find the mean price for bananas per pound. Round to 3 decimal places.
b. Find the median price for bananas per pound.
c. Find the mode price for bananas per pound.

10. The number of absences for five children in a local kindergarten class is as follows.
a. Complete the table and use the computing formula
to find the standard deviation for the number of absences. Round to 3 decimal
places. Note: if you would prefer to use the other formula for standard
deviation then adjust the table accordingly.
b. What is the range for the number of absences?
c. Which appears to be a better measure of variation for this data set: range or
standard deviation?
d. What is the variance?

11. True or False.

For the data set {2,3,4,3,6,75}, the median is a better measure of
center than the mean. Explain.

12. Suppose that the mean score on this test is 75.6 with a standard deviation of 7.8.
Suppose also that the scores follow a bell-shaped distribution.
a. Convert a score of 80 to a z-score. Round your answer to 2 decimal places.
b. How many standard deviations is a score of 80 from the mean?

View Full Posting Details