Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q 4 Labs) lab 3 Create a directory called lab3. Submit your source file (must be named lab3.c) and screen shot - the screen shot

image text in transcribed

image text in transcribed

Q 4

Labs) lab 3 Create a directory called lab3. Submit your source file (must be named lab3.c) and screen shot - the screen shot must include the compilation command with -Wall and the successful running of the program times. You must follow the description in the book except you will generate N random numbers instead of reading the numbers in. You will ask the user for the number of numbers and also ask the user for the upper limit on the numbers. Make 3 runs, run 1: 20 numbers 1-100, run 2:20 numbers 1-100, run 3: 1000 numbers 1-5000 (The first 2 are the same input to test that you are getting two different outputs) Create a function to generate the average of the numbers and the standard deviation. Must print all doubles with only 2 numbers after the decimal point INPUT/OUTPUT: Enter the number of random integers to generate: Enter the upper limit of numbers to generate:
    With numbers from 1 to
      , generated randomly: Smallest: , Largest: , Average: , Std Deviation: . Use the math library functions pow and sqrt DO NOT USE GLOBALS. Must comment your code. 98% Crest - 7.50 6.27 5.04 3.79 2.54 1.27 Principal 163.57 164.80 166.03 167.28 168.53 169.79 Balance 836.43 671.63 505.60 338.32 169.79 0.00 Final payment $171.06 4. a. Write a program that will find the smallest, largest, and average values in a collection of N numbers. Get the value of N before scanning each value in the collection of N numbers. b. Modify your program to compute and display both the range of values in the data collection and the standard deviation of the data collection. To compute the standard deviation, accumulate the sum of the squares of the data values (sum_squares) in the main loop. After loop exit, use the formula sum_squares standard deviation = - average N 5. The greatest common divisor (ged) of two integers is the product of the inte- gers' common factors. Write a program that inputs two numbers and imple- ments the following approach to finding their ged. We will use the numbers -252 and 735. Working with the numbers' absolute values, we find the remainder of one divided by the other
    <>
<>

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

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions

Question

Determine the amplitude and period of each function.

Answered: 1 week ago

Question

LO5 Describe job analysis and the stages in the process.

Answered: 1 week ago