Not Yet Answered # Hey guys! Plz help me!!

Valaraukar 4 Nathaniel10 34 nbaztec 45 Stefano Mtangoo 441 nbaztec 45 Stefano Mtangoo 441 Discussion Starter cdh1944 nbaztec 45 Stefano Mtangoo 441 Discussion Starter cdh1944 Stefano Mtangoo 441 Discussion Starter cdh1944 Stefano Mtangoo 441 Discussion Starter cdh1944 Stefano Mtangoo 441 Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...

Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...

0

What specifically are you having trouble with?

You just need to create a function or two that will perform the maths calculations exactly as stated. Define a value for PI or use the math header file and then assign the stated value for x and plug it into your functions.

Maybe you should try writing out your (attempted) solution as pseudo code first so that you can get your head around what you need to do. Then translating from pseudo code to C should be relatively simple.

0

I am new to C++ and am still learning it. In college decades ago, I took Cal III and learned about the Maclaurin and Taylor series expansions. A couple of years ago I dusted off my old textbook and wrote a Javascript program that computes normal probability values using the Taylor series expansion. I understand how to write your program.

The issue is whether YOU understand the problem to be solved. Before I could write the normal probability program, I had to compute the normal probabilities BY HAND! I wrote pseudocode to organize the different parts of the program. (One part, for example, is the factorial function.) I drew a flowchart to track the movements of values, specifically, the function calls and function returns. (For example, the call of the factorial function and the return of the factorial function value.)

If you are able to answer the problem's questions by hand, then you can (eventually) write a C++ program to solve the problem. People on this site will be able to help you with the code. If you can't, then no one can help you. Others will be able to solve the problem for you, but you yourself still won't be able to solve it. You would need to go back to calculus and improve your understanding of infinite series.

Why don't you share some pseudocode or anything else you have done to organize your thoughts and ideas about this problem?

0

```
const int Pi = 3.14; //Constant
int toDeg(int rad)
{
return rad*180/Pi;
}
float x = 0.3f*Pi; // x = 0.3PI
int n = 10; // n = 10
float valOrig = cos(toDeg(x)); //To degree from radian
float valComp = 0.0f; //Compute this value
float Es = (0.5 x pow(10,2-n); //Es
float Ea = 0.0f; //Compute Ea later
int i=0; //Loop counter
do
{
valComp += pow(-1,i)*pow(x,2i)/fact(2i); //Maclaurin Series
Ea = (valOrig - valComp)/valOrig; //Compute Ea
i++;
}while(Ea < Es);
```

That should be all.

0

`const int Pi = 3.14; //Constant int toDeg(int rad) { return rad*180/Pi; } float x = 0.3f*Pi; // x = 0.3PI int n = 10; // n = 10 float valOrig = cos(toDeg(x)); //To degree from radian float valComp = 0.0f; //Compute this value float Es = (0.5 x pow(10,2-n); //Es float Ea = 0.0f; //Compute Ea later int i=0; //Loop counter do { valComp += pow(-1,i)*pow(x,2i)/fact(2i); //Maclaurin Series Ea = (valOrig - valComp)/valOrig; //Compute Ea i++; }while(Ea < Es);`

That should be all.

Are you here to make people cheat their professors? :@

OP haven't shown any effort than dumping the question.So he/she will copy and pasted and cheat the prof. That is NOT what Daniweb is all about.

*Edited 6 Years Ago by Stefano Mtangoo*: n/a

0

Oh! I thought Nathaniel10's post to be OP's post & hence I gave my step-by-step procedure thinking he didn't understand the question. Guess I screwed up this time past the 30min mark.

Will be careful next time. :(

0

Will be careful next time. :(

Its ok!

there are people who would like to earn degree through another body, that is lying cheating....full garbage :)

0

lol~! I can handle these Q by my hand, but the plob is I've no idea about c++. lol..

I tried to make any code for this by myself and find some code...

I even can't understand any code of c++

Could you recommend some book to study of programming for me?

0

If you can manage to scribble up an algorithm, starting with the general term of the Maclaurin/Taylor Series then only the code semantics need to be placed in order.

0

Could you recommend some book to study of programming for me?

Now you are talking :)

Check there is recent thread on that and I shamelessly recommended, among others Soulie's tutorial at cplusplus.com

0

Wow, Thanx mate~!

But, I'm still dizzying.

I'm try to solve it and make code step by step,

I've got a question.

How can I make Maclaurin Series ??

1) add = pow(-1,i) * pow(x, 2*i) / factorial(2*i);

2) valComp += pow(-1,i) * pow(x,2i)/factorial(2i);

when I do 'Debugging' both way, there are several errors which make me crazy...

0

We need those errors to help you!

BTW have you skimmed though tutorial to get idea of what C++ looks like?

Without doing that will be like someone walking in streets of Dar es salaam going to Manzese and he have never been in Dar es salaam and don't have any map.

He will not get anywhere and will keep "making errors"

0

This c++ problem goes over my head..... lol

*Edited 6 Years Ago by cdh1944*: n/a

0

This c++ problem goes over my head..... lol

love shortcuts? They are long cuts under disguise :icon_lol:

Read and have the basics. Else you cannot resolve your question

0

Thankx!! evstevemd & nbaztec !!

Finally I made up my fantastic code!!!

Because of your advises, I could learn a lot!!

I've got another Q, I'll try it with big smile!! :>

0

Thankx!! evstevemd & nbaztec !!

Finally I made up my fantastic code!!!

Because of your advises, I could learn a lot!!

I've got another Q, I'll try it with big smile!! :>

I Love people who show effort, Bravo!

If you have a question then welcome. For this thread mark it solved

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:

```
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click
Dim txtB1 As New TextBox
Dim i
For i = ...
```