Question: Create CO2 G4(A), G11(B) 4 private and protected. 1.A constructor is a special member function that automatically initializes the objects of its class, supporting


Create CO2 G4(A), G11(B) 4 private and protected. 1.A constructor is a special member function that automatically initializes the objects of its class", supporting this statement with a program of all types of constructors. Also enlist the characters of constructors. 2.Write a program which takes the value from the user as input electricity unit charges and calculate total electricity bill according to the given condition. Use if-else statement. a. For the first 50 units Rs. 0.50/unit b. For the next 100 units Rs. 0.75/unit c. For the next 100 units Rs. 1.20/unit d. For unit above 250 Rs. 1.50/unit 10 e. An additional surcharge of 20% is added to the bill 1. Write a function that takes your date of birth in YYYY, Create C01 MM and DD format (separated by spaces) as input as well G5(A), G8(B) as the current date, in the same format, and calculates 7 your age in years, months and days. Use separate function for age calculation. 2. Can we have more than one destructor in a class? Write a Program to add two complex numbers using the concept of constructor. 1.Write a program which takes upper and lower limit Create CO1 (integer values) and prints Fibonacci series within the range. Fibonacci series is a series where the current number is the sum of previous two terms i.e., 0, 1, 1, 2, 3, 5, 8, 13, 21, ((n-1)+(n-2)) 2. How inheritance supports reusability features of OOP? Explain with example G6(A), G13(B) 1.Write a program which takes an array as user input using pointers. Pass the array to a function using call by reference method and find the most occurring element. Return the result to main function and display it. 2. What is the need of passing objects as arguments. Create CO1 G7(A), G14(B) S.NO Assignment of Object Oriented Programming (BTCS 302-18) Assignment Questions Questions BTL CO Group Assign 1 1.Create a class called student with three data members (stdnt_name[20], faculty[20],roll_no), a function called readdata() to take the details of the students from the user and a function called displaydata() to display the details of the students. In main, create two objects of the class student and for each object call both of the functions. 2. Explain the concept of polymorphism by an example in C++. Create CO1, G1(A), CO4 G3(B) 1.Create a class student containing data members: - Rollno - name -marks 1, marks2, marks3 Write necessary member functions: 1. to accept details of all students 2. to display details of one student 3. to display details of all students (Use Function overloading). 2.How inheritance supports reusability features of OOP? Explain with example Create CO1 G2(A), G10(10 3 1. WAP to create two distance objects with data members Create CO3 feet, inches and a function call by one object passing the G3(A), G12(B) second object as function argument and return the third object adding two objects. 2.Discuss the role of access specifiers in inheritance and show their visibility when they are inherited as public,
Step by Step Solution
There are 3 Steps involved in it
You ... View full answer
Get step-by-step solutions from verified subject matter experts
