Monday, April 3, 2017

Learn Programming by Coding.

1. Write a functions add/sub/multiply/divide which will take two numbers and perform these operations.
2.  Make the program 1 menu driven. There should following options:
                 Menu:
                            1. Add
                            2. Substract
                            3. Multiply
                            4. Divide
                            5. Exit
3.a Write a function which will take a number and print all it's factors.
3.b Write a function which will take a number and instead of printing return all it's factors.
4.  Implement your own arrayList class and implement the following functions:
     a.    add(int num)  //this function will take input number and add it to your arraylist.
     b.    add(int num,  int position)  //this function will take input number and it to the given position.
     c.    clear()  //this function will delete all the elements from the array.
    d.     length()  //this function will return the number of elements in the array.
    e.     is_empty()  //this function will return true if there is no element in the array or else return false.
   f.       index_of(int num)  //this function should return the index of num from the array. If the number is not present in the array then return -1.