Well, thank you for the harsh help and I wish that I could do all of that, and had all of the time, but my program is due in 4 hours, and I had to make the thing work for the situation that came up. ...
Type: Posts; User: StaticKyle
Well, thank you for the harsh help and I wish that I could do all of that, and had all of the time, but my program is due in 4 hours, and I had to make the thing work for the situation that came up. ...
double sine(float angle)
{
#define EPSILON 0.000001
#define PI 3.14159265358979323846264338327950288419716939937510582097494459
double x = (angle * PI) / 180;
int i;
int sign = 1;
double...
Heh, thanks, that was pointed out to me by another person in another one of my codes and I just forgot to change it.
Thank you :D
I think it is just by using an array of ints, but I'm not...
Oh yeah, the input file:
Smith Sam Computer_Services 18.24 Blue
Jones Mary Accounting 8.96 Green
Jones Tom Sales 16.27 Hazel
Cameron Bob Computer_Services 22.01 Blue...
Hello again, I decided to post this in C++ because I'm actually doing my code in C++ now. Anyways, in another program that I was assigned (I'm sorry for posting homework, but I am just out of time to...
YAY! I just want everyone to know that I got it working right. Thanks for all of the help guys!
Lol, awesome. Thank you. Now I just feel like a retard.
Now to try and figure out the other method. Is there any way for me to simply use this one and do an if else statement?
Yes, I am given the number in degrees, but I convert it to radians.
I plug 45 into the program, and it returns .707107
but when I plug it into my calculator, I get .8509035245
Okay, I implemented yours, laserlight, and I tested it and the answer that I got with setting the loop count or n to 15 wasn't close to the value that I got from my calculated value.
Thank you chakra, I figured out that first one with the & a while back, but I never realised about the fileoutname thing. I had it in almost all of my code and it still worked, so I'll try and remove...
Please people, I really really need some help on this, I tried several things and none have worked. Any ideas or any help would be very much appreciated.
Sigh... The sine function didn't work right. Any ideas on how to fix it?
double sine(float angle)
{
#define EPSILON 0.000001
int d = 1;
double guess = 0;
int i = 1;
float...
I don't think so. But I'm not 100% sure. (I have no idea what it is actually..lol). But I'm having some issues with the main program. I'll post it and see what you guys think. It gets stuck after I...
Awesome, thanks.
Is there any compilers that you guys would recommend to use? I'm using visual studio 8 command prompt and I don't think it is very good, but I've been able to use it before....
Thanks :D
But I have a different question now, (because I'm pretty sure I'm still doing something wrong.) I am compiling this program on a windows machine and I am supposed to use a static...
Well, it isn't compiling, so I'll take it as a no..lol
Okay.. so... lets try this again. (I'm sorry for this again)
double sin(float angle)
{
double guess;
int i = 1;
float x2p1 = angle;
for (guess = angle;...
double sin(float angle)
{
double guess;
for (guess = angle; !(fabs(guess * guess - angle) < EPSILON); guess = ((guess * x * x * -1) / ((x * 2) +1)!)
{ }
return...
Okay, this is my attempt to get the required results that are in the first post:
double sin(float angle)
{
double guess;
for (guess = angle; !(fabs(guess * guess - angle) <...
The ** doesn't work in C? Lol.. I've been programming in Ada for too long then.
So, instead of the x**(2n+1) I just use x*x *-1, or would it be y = y *x*x*-1? (Again, sorry if it is annoying, I'm...
I'm sorry if this is frustrating, but I really don't know what a x2p1 variable is. But yeah, I'm sorry about the ^ thing, meant to put **, but oh well. Bleh, I actually feel more confused now.
Yeah, that was a typo, so here is maybe a better one.
int d = 1;
double y = x;
double m = -1;
for (i = 1; i < 10; i++)
{
k = 2*i+1;
d = d * k * (k-1);
Awesome! Now lets see if I can actually write out the loop and then figure out the other part.
for (i = 1; i < 10; i++)
{
if (i % 2 == 0)
{
x = x + (x^(2i+1)/(2n+1)!);
...
So maybe this... (x^n/n!) * -1?
I'm really trying to understand this.. I just can't seem to understand how to get it going from x^3 to x^5 ... in increments of two, and also the whole adding and...
Would it be something like this (Sorry, I remember what it is, but I have never been good at creating them.. Never actually been taught on how to even try to do it, so here goes.)
Summation of...