Thursday, August 6, 2009
LINUX commands
2.. cat
3.. Date
4.. echo
5.. pwd
6.. cp
7.. mkdir
8.. mv
9.. rm
10.. rmdir
11.. head
12.. wc
13.. whoami
14.. who
15.. vi
16.. uname
17.. umount
18.. tty
19.. tar
20..tee
21..tail
22.. rpm
23.. sh
24.. sort
25.. more
26.. find
27.. clear
28.. cal
29.. chmod
30.. merge
31.. sudo
32.. talk
33.. touch
34.. write
35.. last
36.. od
37.. gcc
38.. g++
39.. cut
40.. cmp
41.. cc
42.. banner
43.. bc
44.. join
Wednesday, April 15, 2009
LAB TEST OOPS
2. Concatenate 2 strings by overloading + operator
3. WAP to add 2 complex numbers by returning objects
4. WAP to swap private data of 2 classes.
5. Create a base class called shape .Use this class to store two double type values that could be used to compute the area of figures. Derive two specific classes’ triangle & rectangle from the base class shape. Add to the base class a member function get_data () to initialize base class data members and another member function display_area () to compute and display the area of the figure. Make display_area () as a virtual function & redefine this function in the derived class to suit their requirements.
6. To read a value of distance from one object and add with a value in another object using friend function.
7. WAP to implement addition operations on complex numbers using constructor overloading
8. String concatenation using dynamic memory allocation concept.
9. To compute the area of triangle and rectangle using inheritance and virtual function.
10. Design a class from which only one object can be created. If more than one object is created, then the program should terminate.
Friday, March 13, 2009
OOPS ASSIGNMENT - 9
1. Write a program which should have two classes A and B,A contain two data members and 3 methods and B class is inherited by class A, Class B contains one data member and two methods. Now multiply the two values of class A by using the object of class B and display the result.
2. Write a program which having 3 classes student, test and result, student class having method to accept enrollment number, test class accept student marks in 3 subjects which is inherited by class student and result class having methods to find sum of marks and displays, which is inherited by class test. Now by using the object of result class call the methods from other classes.
3. Create a class Basic_info having data members Player ID, Name, Age. Derive a class Add_info from Basic_info having data members player_type, height & weight. Include suitable member functions to input and display the data?
4. A bank maintains two types of accounts
Saving: includes
Compound interest
Withdrawal
Current
Minimum balance required
Create a class “account” that stores customer name, account number and type of account. From account derive cur_acc and sav_acc. Include necessary data members and member function to perform following tasks.
i. Accept deposit and update balance
ii. Display the balance
iii. Compute and deposit interest
iv. Check for minimum balance
5. Create a class student which includes name and roll number of the student. Derive classes test and sport out of class student which include test marks and sport marks respectively.
Derive a class result out of test and sport where total marks are calculates and displayed
Test the class result.
Friday, February 27, 2009
OOPS ASSIGNMENT - 8
1.Write a program to find the factorial of a number using recursive member function.
2.write a program to find the sum of the digits of a number using recursive member function.
3.write a program to find the sum of n numbers using recursive member function.
4.write a program to find the gcd of two numbers using recursive member function.
Recursive constructor
1.write a program to find the factorial of a number using recursive constructor.
2.write a program to find the sum of n numbers using recursive constructor.
3.write a program to find the sum of the digits using recursive constructor.
4.write a program to find the gcd of two numbers using recursive constructor.
OOPS ASSIGNMENT - 7
1.write a program using constructor to find the area of a rectangle. This includes two data members(length and width), two member functions one is to display the length and width, other is to calculate the area and display that area.
2.Create a class to store a string. Include member functions to input and output the data member. Write the above program using constructor and destructor.
3. Write a C++ program by using the parameterized constructor.
4. Write a program by using the copy constructor concept to accept a number display that number.
5. Implement and test a class complex to store
.Real
.Imaginary
Include following constructors
.Default (to initialize both data members by zero value)
. One argument (to initialize both data members by a single value)
.Multiple argument (to initialize both data members by different value)
· Copy
Include destructor
6. Create a class to store string dynamically
Include following constructors
· Default (to initialize string to null value)
· One argument (to initialize string by a given value)
· Copy
7. WAP to implement a polynomial class having data members’ coefficient, base and power. For example, the polynomial 2x5 has the coefficient 2, base x and power 5. Include default and parameterized constructor and also include a member function evaluate () to find the value of the polynomial.
For example, if the polynomial is 2x5.
X=2, 2x5=64 is the answer.
Monday, February 16, 2009
Assignment-6
Q.1: Program to add two complex numbers using objects as arguments.
Q.2: Program to add time in hour and min using objects as argument.
Q.3. Create a class using friend function to calculate the mean of two values and parameter for the mean function should be object of the same class.
Q4.Create two classes using friend function i.e max to find the maximum value and parameters for the max function are two objects of the two classes.
Q.5.A library uses computer based information system for keeping track of its collection. With each book the information system stores the following information.
(i) Accession no of the book (an integer)
(ii) issue code with I,B,L,A indicating issued to a member, send for binding, Issued to another library and available respectively
(iii) Identity of the member which is an alphanumeric quantity.
The services extended by the library are
(a) Provides status of a requested book
(b) Provides list of all issued book
Q.6. Create two classes A & B with data members i and j respectively. Include friend function swap () to swap the values in the data members of the two classes.
Q.7.WAP to count and display the number of objects created in a class. (Use static variable)
(c) Provides list of books issued to a member
Friday, January 30, 2009
OOPS ASSIGNMENT- 5
2. WAP to calculate simple interest by passing the principal amount, rate of interest and time period as argument to function. Make rate of interest and time period default argument with default values 1.2 and 3 respectively
3. Raising a number n to power p is the same as multiplying by itself t times. Write a function called power ( ) that makes a double value for n and an int value for p and returns the result as double value. Use default argument of 2 for p, so that if this argument is omitted, the number will be squared. Write a main( ) function that gets values
from the user to test this function.
4 Write a function “increment” which takes two arguments and increment the first argument by second pass the argument to this function from main and print the increment value in the main function (use reference variable).