Ohhh i see what you mean, you want the decimal in the same column? The mistake is that %4 is four characters, not four numbers. Change it to %5.2 and it works, remember that 10.00 is five...
Type: Posts; User: euclid
Ohhh i see what you mean, you want the decimal in the same column? The mistake is that %4 is four characters, not four numbers. Change it to %5.2 and it works, remember that 10.00 is five...
I tried it and it looks all good... whats the problem exactly?
enter diameter to calculate radius:
10
diam radius
10 5.00
20
diam radius
Just to say THANK YOU to everyone who replied, I understand it much better now. I did a little reading on union-find stuff (i found this pdf quite useful) and I've managed to use it correctly in my...
Thanks a lot, that makes it very clear
Cheers, thats very helpful.
(by the way, the code is used as part of a Hoshen-Kopelman Algorithm (i got it from here) to identify and label clusters of 1's in a 2d array of 1's and 0's. I am...
Well I spoke to my professor today and he couldn't understand it either, this is clearly some sort of CS black magic that is impenetrable for physicists!
I worked through the example stahta01...
haha, yes I am a physics student not a CS student, i guess i have a mathematical mindset.
Thanks anyway, you pointed me in the right direction im sure ill get it eventually
OK, thanks for getting back to me. Forgive me for being a bit slow, but I'm struggling to get my head around this. Let me try and explain my reasoning -
while(labels[y] != y) checks if the...
Hi, I know this is probably a silly question but I am having trouble understanding a piece of code i am looking at -
while (labels[y] != y)
y = labels[y];
What exactly does the...
Im still working on this one, with not much luck.
(assuming even values of n only) I now get the correct answer using values of x=0.1 and 0.2 with a y value 0.01. Any x > 0.2 causes the program...
Thanks, i will look at this part.
Was wondering if someone could offer me some advice..
I am trying to evaluate sin(x) using the recurrence relation sin(ny) = 2cos(y)sin((n-1)y)-sin((n-2)y).
The problem states that i take y =...
I cant see what else i can do to them, arrrg i think ill just give it in as it is, at least i gave it a go. Thanks to all who replied
#include <stdio.h>
void generatePrices(float...
i think ive sorted that out... now on to the next one :rolleyes:
i now get told that 'called object is not a function' for the following line from main
else{
...
....hmmm, that may well be the problem... thanks :s
I'm still struggling with this one im afraid :confused:
Heres my revised code..
My (current) problem is that im getting 'syntax error before float' for the line in red.. I've tried changing it...
ahhh thanks
thanks, i'll give it a go.
For some reason the compiler is now giving me a different error, its saying
"[Warning] statement is a reference, not call, to function `generatePrices' ", im at a loss...
The assignment is to write a program containing 3 fuctions, main, a function to fill the array and one to work out the average share price between startDay and endDay which are entered by the user.
...
Thanks, i hadn't noticed that
I'm trying to do that atm, but keep getting various errors.. If i haven't got any further in a hour or so i'll post my attempt and the errors.
Thanks for the help, i know noobish questions are...
Sorry, my fault i should make it clearer. I need a fluctuation of 0.5 from the start price (ie, if start price is £1, prices between 50p and £1.50.
Regardless of the questionable maths, would...
Ok, another week, another assignment, another question
I'm trying to write a program that will track a share price, and to do so need to fill an array with random fluctuations, say 0.5 either...
thanks for all the help, this is the finished code, which now tests itself and prints out the results..
#include <stdio.h>
int howManyDays ( int fromMonth, int toMonth ); //declare numDays...
ahhh think i got it, its compiled now at least
#include <stdio.h>
int howManyDays ( int fromMonth, int toMonth ); //declare numDays function
int main () //Start of main function
{