440error / Semester-1-practicals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Semester-1-practicals

1- Write a program to compute the sum of the first o tenns of the followiog series: S = I - I / (2" 2) + I / (3" 3) - ... I / (o "n) where " is exponentiation. The number of terms n is to be taken from user through command line. If 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 following operations on strings (without using inbuilt string functions):

   • Show address of each character in string 
   • Concatenate two strings. 
   • Compare two strings 
   • Calculate length of the string (use pointers) 
   • Convert all lowercase characters to uppercase 
   • Reverse the string

5-Write a program to merge two ordered arrays to get a single ordered array.

6- Write a program to search a given elemenl in a set of N numbers using Binary search

  • with recursion • without recursion.

7- Write a program to calculate GCD of two numbers (i) with recursion (ii) without recursion.

8- Create Matrix class. Write a menu-driven program to perform following Matrix operations:

  • Sum • Product • 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 displayO method in all the three classes to display the corresponding attributes. Provide the necessary methods 10 show runtime polymorphism.

10- Create a class Triangle. Include overloaded functions for calculating area. Overload assignment operator and equality operator.

11- Write a program to read two numbers p and q. If q is O then throw an exception else display the result of p/q.

12- Rewrite Matrix class of Q8 with exception handling. Exceptions should be thrown by the functions if matrices passed to them are incompatible and handled by main() function.

13- 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 file and display them.

14- Copy the contents of one text file to another file, after removing all whitespaces.

About


Languages

Language:C++ 100.0%