tony_lynes_lab2.c

tony_lynes_lab2.c - *Tony Lynes*CSCI 112 Lab 2#include...

This preview shows pages 1–2. Sign up to view the full content.

/* *Tony Lynes *CSCI 112 - Lab 2 *2/8/2016 */ #include <stdio.h> /*math.h gives us the ability to use square root in the equation*/ #include<math.h> #include<float.h> /* Establish our double values at the top */ double current, sum, sum_squares, lowest, highest, range, average, std_dev; /* This function is getting an input from the user, not to provide a result, but to be used to determine how many values the user will enter*/ double get_input(void) { /*variable "t" serves no abreviation*/ double t=0; printf("Enter a number: "); scanf("%lf", &t); return t; } /*This function is prompting the user to give a value that will be the amount of entries, therefor is cannot be negative*/ int get_n(void) { /*Since the amount of entries can't be a fraction, an integer will be used*/ int n; n= -1; /*Will repeatedly prompt user for a value in the target range, until the conditions are met*/ do { printf("Enter a value for N that is >=0: "); scanf("%d", &n); /*This if statement will tell the user that their value for n does not meet the specifications, and will allow another integer to be entered*/ if (n<0) {

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern