OddSeq and EvenSeq, Computer science Lab Work help

OddSeq and EvenSeq, Computer science Lab Work help

Lab work

Consider the following abstract class:

classNumberSeq {

  public:

  virtualint find(int k)=0;

  voidprintSeq(int k, int l); // print the number from index k to index l

};

Write the implementation of printSeq()at the base class only as well as the OddSeq and EvenSeqderived classes that implement find() method, which returns the kth odd or even number, respectively, depending on the derived class being used.

Note:

·  Even numbers: 2*k, where k is the index of the kth even number

·  Odd numbers: 2*k-1, where k is the index of the kth odd number

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper