From 5f4dab2718f3024b3cb1c9e3612aecc2deeb62f2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 13 Jul 2016 10:27:13 -0400 Subject: [PATCH 1/2] Progress --- assignment8.txt | 21 +++++++++++++++++++++ inout.c | 42 ++++++++++++++++++++++++++++++++++++++++++ inout.txt | 9 +++++++++ sort | Bin 0 -> 8768 bytes sort.c | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 110 insertions(+) create mode 100644 assignment8.txt create mode 100644 inout.c create mode 100644 inout.txt create mode 100755 sort create mode 100644 sort.c diff --git a/assignment8.txt b/assignment8.txt new file mode 100644 index 0000000..541ce08 --- /dev/null +++ b/assignment8.txt @@ -0,0 +1,21 @@ +Emma Ladouceur + +//This is most likely incorrect because I didn't really understand the memory leaks, but I looked up a bunch of stuff + + +1. +abcabc1 +abc1 +abc123 + +2. +I think it's 0 but i'm not sure + + +3. +NONE + + +4. + +NO CHANGE diff --git a/inout.c b/inout.c new file mode 100644 index 0000000..0ce7a6b --- /dev/null +++ b/inout.c @@ -0,0 +1,42 @@ +//Emma Ladouceur + +#include +#include +#include +int main(){ +FILE *inFile = fopen("inout.txt", "r"); + + +char inout[100]; + +float a; + +fgets(inout, sizeof(inout), inFile); +int i; +float total, mean, sumsquare, std; +for(i = 0; i<=9; i++){ + +a = atof(inout); +printf("%f\n", a); +fgets(inout, 100, inFile); + +total = total + a; + +} +int numarr[9]; + +mean = total/9; +for(i=0; i<9;i++){ + +sumsquare = (total-mean)*(total-mean); + +} +std = sqrt(sumsquare/i-1); + +printf("The average is: %f\n", mean); +printf("The Standard Deviation is: %f", std); +fclose(inFile); +return 0; + + +} diff --git a/inout.txt b/inout.txt new file mode 100644 index 0000000..f0acceb --- /dev/null +++ b/inout.txt @@ -0,0 +1,9 @@ +8 +7.83 +3.55 +3.78 +9.34 +5.75 +8.23 +6.66 +6.89 diff --git a/sort b/sort new file mode 100755 index 0000000000000000000000000000000000000000..caba006f2cc236717d0013300c5f1dfa6d30fa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C{j8`%4E`DgvQ)I6&Ij=xr-<@1pe#Q`Mfti$%apPf~}i%PK$ zoa*j9r#uRb&O&TI6wo0F?0+S5&QrEz``|S3!+7W{!}h#CzM|~aXEW#g#(K=3ggu>& zSmu57yt3DkPvni?Munh#549=V^M1QoH8ggHlDzH5_zC2aYL~6%?8|j!KcR54CmV13 zJqwK5mEt4f{rjx4=X0)|YnR1o;w3z8d*0_?RrW)q)TRU zX8c2Bxb2;DoGL(PL&e#S`J%_3_rbcd=Q!C7+p&BT3BtJkynpOhhF*Qu9BeKE00?V! z5Ie#4_j_=*XTA>kT((TJWaqcbue~hshi~s-t literal 0 HcmV?d00001 diff --git a/sort.c b/sort.c new file mode 100644 index 0000000..9a82aac --- /dev/null +++ b/sort.c @@ -0,0 +1,38 @@ +//Emma Ladouceur + +//Homework + +#include + +int main(){ + int i, j,a,n,array[30]; + + + printf("Enter a value for N \n"); + + scanf("%d", &n); + + printf("Enter the numbers"); + + for(i=0; i array[j]){ + a = array[i]; + array[i]=array[j]; + array[j]=a; + + + } + + } + + } + printf("The numbers are arranged in ascending order"); + for(i=0;i Date: Wed, 13 Jul 2016 10:29:53 -0400 Subject: [PATCH 2/2] Updated homework, emma. --- sort | Bin 8768 -> 8768 bytes sort.c | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sort b/sort index caba006f2cc236717d0013300c5f1dfa6d30fa46..fb791f901df45836df5dd8208a0df35c0bb40543 100755 GIT binary patch delta 363 zcmX@$a=>N61Hgq1_p95F8 zesV6mu4o}p`N_j+di?S&AoUFV@-7SvlNYcrm>j{OW2KtH#lR@dY;6LRVFluXKmY$X z0OqyTZkGD8|ph7%+LEoIWQa$ZpD+bFP2};EK(X H^6Jb0?7Mh7 delta 373 zcmX@$a=>N61qA8#%B|NlQo`n5_onC&s6+oiRk z^Voh{xWWaKRteAX~L!a@+CU2V=_Qg>w3wh`_rkXU@3; N8k9RWOUkP=0|01Jf2aTe diff --git a/sort.c b/sort.c index 9a82aac..e2e21af 100644 --- a/sort.c +++ b/sort.c @@ -1,5 +1,5 @@ //Emma Ladouceur - +//Hmmm... still working on this, but i'm a little confused. I have a text book that I'm going to go through and try and work on this... but below is my sort. //Homework #include @@ -12,7 +12,7 @@ int main(){ scanf("%d", &n); - printf("Enter the numbers"); + for(i=0; i