Giter Site home page Giter Site logo

cpp-practicals's Introduction

cpp-practicals

  1. Write a program to compute the sum of the first n terms of the followiog series: S = 1 - 1 / (2^2) + 1 / (3^3) - ... 1 / (n^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):

(i) Show address of each character in string (ii) Concatenate two strings. (iii) Compare two strings (iv) Calculate length of the string (use pointers) (v) Convert all lowercase characters to uppercase (vi) Reverse the string

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

  2. Write a program to search a given elemenl in a set of N numbers using Binary search (i) with recursion (ii) without recursion.

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

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

(i) Sum (ii) Product (iii) Transpose

  1. 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.

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

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

  4. 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.

  5. 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.

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

cpp-practicals's People

Contributors

markmemayank avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.