Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

Browse PRACTICAL FILE PRESENTED BY:-RINKY SACHDEVABSc. Comp. Sc.(H)Ist year(IIndsem)Roll No.

:206-Software Lab based on 201 (C++ and Data Structures)Questions ? Ques.1:WAP to perform the following operations on integer:i)To check if number i s prime or not.ii)To print the sum and product of the number s digits.iii)To rever se the number.Ques.2:Write a function that checks if a string is Palindrome orno t. Use this function to check user entered strings.Ques.3:WAP to perform the fol lowing on user entered array:i)Print the even valued elements.ii)Print the odd v alued elements.iii)Calculate and print the sum and average of theelements of the array.iv)Print the maximum and minimum elements of thearray.v)Sort the array.vi )Remove the duplicates from the ordered array.vii)Compact the array.viii)Print t he array in reverse order. The program should present a menu to user and ask for one of the options. The menu should also include options tore-enter the array an d quit the program.Ques.4:Create Matrix class. Write a menu-driven program toper form the following operations(2-D array implementation):i)Sumii)Differenceiii)Pr oductiv)TransposeQues.5:Write a program to search an element from a list. Giveus er the option to perform Linear or Binary Search. Use Templatefunctions.Ques.6:W AP to sort a list of elements. Give user the option toperform sorting using Inse rtion sort, Bubble sort or Selection sort. Ques.7:WAP that prints a table indicating the no. of occurrences of each letter of alphabet in the text entered ascommand line arguments.Ques.8:Write a macro th at calculates the area of a circle. WAPto use it.Ques.9:Write a macro that swaps two numbers. WAP to use it.Ques.10:WAP to perform the following operations on s trings:i)Show address of each character in string.ii)Concatenate 2 string withou t using strcat function.iii)Concatenate 2 string using strcat function.iv)Compar e 2 strings.v)Calculate the length of the string(use pointers).vi)To convert all lowercase characters to uppercase.vii)To convert all uppercase characters to lo wercase.viii)Calculate number of vowels.ix)To reverse the string.Ques.11:Create a class Rational for performing arithmetic withrational nos.Use integer variable s to represent numerator anddenominator. Write a constructor method that enables an object of class to be initialized when it is declared. Provide an argumentco nstructor with default values in case no intializers areprovided.Provide a copy constructor also. Write methods for:i)Addition, overload + operatorii)Subtraction, overload - operatoriii)Multiply, overload * operatoriv)Division, overload / operatorv )Increment, overload ++ operator(both prefix &postfix)vi)Decrement, overload -- oper ator(both prefix & postfix)vii)Overload operator == (to check equality of tworatio nal nos.) as a friend functionviii)Overload assignment operatorix)Printing in th e form a/b.WAP to test the above class.Ques.12:Create a class Triangle. Include overloaded functionsfor calculating area. Overload assignment operator and equal ityoperator. C++ Programs Add To Collection 2.5K Reads 23 Readcasts 16 Embed Views Published by Rinky Sachdeva TIP Press Ctrl-F to search anywhere in the document. Info and Rating Category:

Uncategorized. Rating: Upload Date: 04/30/2011 Copyright: Attribution Non-commercial Tags: This document has no tags. download or read online. Flag document for inapproriate content Download and print this document Read offline in your PDF viewer Edit this document in Adobe Acrobat, Microsoft Word, Notepad Keep a copy in case this version is deleted from Scribd Read and print without ads Email the file Choose a format to download in .PDF .DOC .TXT Recommended 94 p. c++ Programs Sugandh Gupta 162 Reads 2 p. Class to Represent a Vector pratyaymodi 1683 Reads 4 p. List of CSHP 101 Practicals Kuldeep Sharma 391 Reads 231 p. C++ Programs Collection Neil Mahaseth 20702 Reads More From This User 61 p. 8085 Slides Rinky Sachdeva 90 Reads 2 p. 7 C s of Effective Communication Rinky Sachdeva 125 Reads 61 p. Copy of Algorithms Rinky Sachdeva 3 Reads 73 p. System Software Rinky Sachdeva 45 Reads Notes Post Note

About About Scribd Blog Join our team! Contact Us Premium Premium Reader Scribd Store Advertise with us Get started AdChoices Support Help FAQ Press Partners Developers / API Legal Terms Privacy Copyright Copyright 2013 Scribd Inc. Language: English

You might also like