𝑠um = 1 – ½^2 + 1/3^3…..
1. Write a program to compute the sum of the first n terms of the following series:
The number of terms n is to be taken from the user through the command line. If
the command line argument is not found then prompt the user to enter the value
of n.
2. Write a program to remove the duplicates from an array.
3. Write a program that prints a table indicating the number of occurrences of each
alphabet in the text entered as command line arguments.
4. Write a menu driven program to perform string manipulation (without using inbuilt
string functions):
a. Show address of each character in string
b. Concatenate two strings.
c. Compare two strings
d. Calculate length of the string (use pointers).
e. Convert all lowercase characters to uppercase
f. Reverse the string g. Insert a string in another string at a user specified position.
5. Write a program to merge two ordered arrays to get a single ordered array
6. Write a program to search a given element in a set of N numbers using Binary search
(i) with recursion (ii) without recursion.
7. Write a program to calculate GCD of two numbers (i) with recursion (ii) without
recursion.
8. Create a Matrix class. Write a menu-driven program to perform following Matrix
operations (exceptions should be thrown by the functions if matrices passed to
them are incompatible and handled by the main() function):
a. Sum
b. Product
c. Transpose
9. Define a class Person having name as a data member. Inherit two classes Student
and Employee from Person. Student has additional attributes as course, marks and
year and Employee has department and salary. Write display() method in all the
three classes to display the corresponding attributes. Provide the necessary
methods to show runtime polymorphism.
10. Create a Triangle class. Add exception handling statements to ensure the following
conditions: all sides are greater than 0 and sum of any two sides are greater than
the third side. The class should also have overloaded functions for calculating the
area of a right angled triangle as well as using Heron's formula to calculate the area
of any type of triangle.
11. Create a class Student containing fields for Roll No., Name, Class, Year and Total
Marks. Write a program to store 5 objects of Student class in a file. Retrieve these
records from the file and display them.
Output
Binary file
12. Copy the contents of one text file to another file, after removing all whitespaces.
Input file
Output file