tip: use structs for the data like:

C++

Copy Code

struct Data { int index; int minutes1; int minutes2; int minutes3; double median; double SD; } data;

See more:

So first I need to input number using scanf separated by white space in to an array like this :

"Hours" input can be anything

Can only use stdio.h and math.h

**What I have tried:**

I have tried using while loop to find sum

to store in first array then calculate SD with

function command store in another array

but somehow it end up like this so I try to make it

Work at least finding sum of all minutes first.

How many minutes for #1: 1 2 3

How many minutes for #2:

How many minutes for #3:

How many minutes for #4: input able here

so it just skip from 1 to 4

not let me do input in #2 and #3

*I use scanf for most of input

This is finding sum part of the code

Ok so I just add another loop inside the loop

To fix problem above now, but still can't figure out

How to find SD and printf when there are multiple

Maximum values

Full code : https://pastebin.pl/view/de043497

Copy Code

How many hours : 4 How many minutes for #1 : 10 6 55 How many minutes for #2 : 30 50 60 How many minutes for #3: 60 30 50 How many minutes for #4 : 6 7 9 The finest hours are #2 and #3 The score is %d and the Standard Derivation is ___.

"Hours" input can be anything

Can only use stdio.h and math.h

I have tried using while loop to find sum

to store in first array then calculate SD with

function command store in another array

but somehow it end up like this so I try to make it

Work at least finding sum of all minutes first.

How many minutes for #1: 1 2 3

How many minutes for #2:

How many minutes for #3:

How many minutes for #4: input able here

so it just skip from 1 to 4

not let me do input in #2 and #3

*I use scanf for most of input

This is finding sum part of the code

C

Copy Code

If (hours >= 1 && hours <= 60) { for(int i = 1; i < hours-1; ++I) { printf("\nHow many minutes for #1:",i); scanf("%d", &minutes); sum = minutes + sum; array[I] = sum; } return 0; }

Ok so I just add another loop inside the loop

To fix problem above now, but still can't figure out

How to find SD and printf when there are multiple

Maximum values

Full code : https://pastebin.pl/view/de043497

Comments

You must understand the Standard Derivationat first. You must choose whether you use the SD of one measurement or the SD of all data. Best is to seperate it.

tip: use structs for the data like:

tip: use structs for the data like:

C++

Copy Code

struct Data { int index; int minutes1; int minutes2; int minutes3; double median; double SD; } data;

Comments

Make a function that, given a sequence, computes its sum and standard deviation (it could return the two values in a

Then call iteratively such a function over the input sequences, storing the returned values into an array. Eventually choose the 'finest sequences' based on the array values.

`struct`

).Then call iteratively such a function over the input sequences, storing the returned values into an array. Eventually choose the 'finest sequences' based on the array values.

v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8
+1 (416) 849-8900

- maximum values of sum(highest value)

- if there are more than one maximum sum, the lowest SD became the finest hours

- #2 and #3 are both equal in sum and S.D.

I need to compute Sum and Standard Derivation for every hours(sequence)