Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Author's name Due date A description of what the program does. .In general, use lower case letters for variable names. Variable names should be mnemonic.

image text in transcribed

Author's name Due date A description of what the program does. .In general, use lower case letters for variable names. Variable names should be mnemonic. Separate words in a variable name with an underscore or begin the second word with an uppercase l Indent 2-4 spaces (optimally 3) within main. The editor should take care of proper etter indenting. Place no more than one C statement per line. Do not type more than 80 characters per line. Programs 1.Write a program to calculate arithmetic, geometric, and harmonic means of four integers. Prompt the user to enter four integers (must use data type int). Use a single scanf statement to read in the four numbers. a. Calculate the arithmetic mean (average) of the four numbers, noting that n represents the number of values and x,,x,x,and x, are the four numbers. Assign the result to a float or double, avoiding integer truncation. arithmeticmean ", "n - 7 b. Calculate the harmonic mean of the four numbers, again avoiding integer harmonicmean - x 2x c. Calculate the geometric mean of the four numbers. Use the math library function pow. This function may require that you cast the integers as data type double to enable the function to work geometric_mean-x,2x Print the three means with two decimal digits. Note: If the numbers entered are 34, 75, 62, and 50, the arithmetic mean is 55.25 harmonic mean is 50.71, and geometric mean is 53.02

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

b. Will there be one assigned leader?

Answered: 1 week ago

Question

Do you currently have a team agreement?

Answered: 1 week ago