Answered step by step
Verified Expert Solution
Question
1 Approved Answer
pls provide code in C...you may use C math library functions such as sqrt and fabs III.B. STATISTICS Consider a list named X of n
pls provide code in C...you may use C math library functions such as sqrt and fabs
III.B. STATISTICS Consider a list named X of n real numbers The p-norm of the values in the list, here denoted 1 number such that 1p for some real number p > 1, is a real 72 Note: 221i is known as summation notation: 1 2i-Z1 + 22 + . .-+ Zn Example #1 : The taxicab norm, also known as the Manhattan norm, which is the p-norm with p of 1, is a real number calculated as the sum of all the absolute values of the values in the list Note that the name taxicab norm" comes from the fact that it's the distance that a taxicab would travel on streets with lengths equal to the values in the list. Example #2 : The Euclidean norml , denoted llx12, is the p-norm with p of 2 72 Write a program to calculate the statistics described above, for a list of 4 values. The program MUST incorporate the following subsections, in the following order 1. Greeting Subsection: Greet the user with useful information about the program. 2. Input Subsection (a) Prompt the user to input 4 values (b) Input the 4 values, using a single scanf statement. 3. Calculation Subsection (a) Calculate the taxicab norm of the 4 values (b) Calculate the square norm of the 4 values 4. Output Subsection (a) Output the 4 values (b) Output their taxicab norm (c) Output their square normStep 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