Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views2 pages

CPP Index

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

Managed By Vidyamandir Trust

Smt. Tanuben & Dr. Manubhai Trivedi


College for Information Science, Surat
Affiliated to Veer Narmad South Gujarat,
University,Surat

NAME: ________________________________________________
ROLLNO: ___________ DIV: ________ DATE: _________________
SUBJECT: _______________________ YEAR : _________________

INDEX
Sr. Description Page
No. No.

Write a menu driven program that performs following operations on


strings.
1.Find the position of the first occurrence of a given character in a string.
2. Convert a given string into lower case.
3. Find number of occurrences of character ‘e’ in given string.
4. Display a given string in reverse.
1. 5. Check where a given string is equal to “object” or not. 1

Create a class called Car with data members like name, company,
noofseats, fueltype, and price. Include member functions setCar() to
initialize the members with suitable values and showCar() to display car
2. details in appropriate format. 7

Create a class called Book that contains data members such as bookno
(an int), title(array of char), author (array of char) and price (type float).
Include a member function called addbook() to get book details from the
user, and another function called showbooks() to display all the details.
Finally create a member function sortByTitle(), that will sort the data for
all the items in the ascending order of book title. Write a menu driven
program to exercise this class. Invite the user to input data for up to 5-10
3. Books. 9

We want to calculate the total marks of each student of a class in


Physics,Chemistry and Mathematics and the average marks of the class.
The number of students in the class are entered by the user. Create a
class named Marks with data members for roll number, name and
marks. Create three other classes inheriting the Marks class, namely
Physics, Chemistry and Mathematics, which are used to define marks in
individual subject of each student. Roll number of each student will be
4. generated automatically. 14
Write the definition for a class called time that has hours and minutes as
integer. The class has the following member functions: void settime(int,
int) to set the specified value in object void showtime() to display time
object time sum(time) to sum two time object & return time
1. Write the definitions for each of the above member functions.
2. Write main function to create three time objects. Set the value in two
objects and call sum() to calculate sum and assign it in third object.
5. Display all time objects. 18

Write the definition for a class called complex that has floating point data
members for storing real and imaginary parts. The class has the
following member functions: void set(float, float) to set the specified
value in object void disp() to display complex number object complex
sum(complex) to sum two complex numbers & return complex number
1. Write the definitions for each of the above member functions.
2. Write main function to create three complex number objects. Set the
value in two objects and call sum() to calculate sum and assign it in third
6. object. Display all complex numbers. 20

7. Write a program to implement infix to prefix using stack. 22

Write a menu driven program to implement operation of stack.(push,


8. pop, peep). 25

Write a menu driven program to implement operation of Double ended


9. Queue 29

10. Write a program to implement infix to postfix using stack. 37

____________________________
SIGNATURE OF SUBJECT FACULTY

You might also like