Question

Below are a list of sequences of numbers. Your job is to program each sequence with...

Below are a list of sequences of numbers. Your job is to program each sequence with any loop of your preference (while, for, do/while). I want the code to output the sequence provided and the next number in the sequence (you can output more but there is 1 sequence that may only have 1 number after). Each sequence should be in the same main in one .cpp file. . Please order and notate each sequence in your output –. The output should also be horizontal like that shown below (if you output it vertically it will be -10pts). Each sequence should be programed with only 1 loop and optionally 1 selection statement. Hint: a selection statement may be used for the last 3 problems.

Series 1:

15, 14, 13, 12, 11, ...

Series 2:

1, 2, 5, 14, 41, ...

Series 3:

2, 3, 5, 8, 12, 17, ...

Series 4:

15, 13, 11, 9, 7, ...

Series 5:

71, 142, 283, 564, 1125, 2246, 4487, 8968, ...

Series 6:

10, 5, 1, -2, -4, -5, -5, -4, -2, ...

Series 7:

0, 1, 3, 7, 15, 31, 63, ...

Series 8:

0, 1, 4, 13, 40, 121, ...

Series 9:

15, 29, 56, 108, 208, 400…

series 10: (finite)

0, 1, 3, 6, 10, 10, 11, 13, 16, 16, 17, 19, 19, ...

series 11:

7, 9, 14, 20, 27, 33, 42, 52, 63, 73, 86, ...

Series 12:

13, -21, 34, -55, 89 ...

Series 13:

0, 1, 4, 12, 32, 80, 192, ...

The languague is C++. Please can you do it in one file and in an orderly manner.this the 3rd time am posting same question and still dont have the series.i need help especially from series 7 to 13 though i will be glad if you help me with all thanks alot

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<math.h>

#include<iostream.h>

void main()

{//series 7

int x =0,y=1;

int length = 20; //assumed for the length. Change as per your need

do

{

cout << x <<"," ;

x = x + (x+1)

length--

} while (length!=0)

// series 8

length =20;

x=0;

do{

cout << x <<"," ;

cout << y <<"," ;

int diff = y-x; //computes difference between two elements

x = y;

y = y+(3*diff);

length--;

}while(length!=0)

//series 9

x=15;

length = 20;

do{

cout << x <<"," ;

int count = 1;

y = x*2-count;

count = count*2;

length--;

}while(length!=0)

//series 10

x=0;

y=0;

length = 20;

while (length!=0)

{ //this is an additive series where series 0,1,2,3,4||0,1,2,3||0,1,2|| and so on is added

int maxcount =5;

int count = 0;

y=1;

if(count<maxcount)

{x = x+y;

y = y++;

while(count>0)

{

count++;

maxcount--;

}

while (count<=0)

{count--;

maxcount--;}

}

//series 13

x= 0;

y = 1;

for(i = 0;i<length;i++)

{

cout << x <<"," ;

x = x+pow(2,y);

y++;

}

Add a comment
Know the answer?
Add Answer to:
Below are a list of sequences of numbers. Your job is to program each sequence with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT