Question:
I have to do a program on alternating sums using vectors. I am not sure how to start this program. I thought about using an array and every even index add the value and every odd index subtract the value. Does that sound right? Any ideas?
djbsabkcb 0 Junior Poster in Training
Recommended Answers
Jump to Post— Rashakil Fol 978The only good way to do this is to figure it out yourself. You've thought about using an "array," but didn't you just mention "vectors"? You might have correctly described your algorithm; now you just need to implement it.
Jump to Post— shre86 0wat exactly do u mean by alternating sums using vectors??
Jump to Post— Rashakil Fol 978An alternating series is one in which the sign flip-flops. For example,
4 + 4/3 + 4/5 + 4/7 + 4/9 + 4/11 + 4/13
is not an alternating series. But the following is:
4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + 4/13
…
Jump to Post— Reverend Jim 6,665Easily done but you should consider...
- We don't do your homework
- We don't appreciate it when you revive/hijack an old thread
- You really need to read the Daniweb Posting Rules and Suggestions For Posting Questions.
All 16 Replies
Rashakil Fol 978 Super Senior Demiposter Team Colleague
sifuedition 0 Light Poster
shre86 0 Light Poster
Rashakil Fol 978 Super Senior Demiposter Team Colleague
shre86 0 Light Poster
djbsabkcb 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
djbsabkcb 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
djbsabkcb 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
djbsabkcb 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
toom toom 0 Newbie Poster
Reverend Jim 6,665 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
jacklin 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.