Join Our WhatsApp Group Join Subscribe Now!

313304 OOP Practical on Write programs to define the function outside the class

313304 OOP Practical on Write programs to define the function outside the class

 313304 OOP Practical on Write programs to define the function outside the class

The classes and objects help to represent real-life entities with different attributes and related Member functions.

313304 OOP manual Practical no.5 answer

Exercise:

1. Write syntax for define member function Outside the class.
Answer:

return_type class_name::function_name(parameter_list) {
    // Function body
}


2. Write a C++ program to declare a class "staff' having data members name, basic salary, DA, HRA and calculate gross salary. Accept and display data for one staff.

Where DA=74.5% of basic
1. HRA= 30% of basic.
ii. Gross_salary=basic+HRA+DA

Answer:


Practical Related Questions

1. Write a program to find area of circle such that the class circle must have three functions
namely:

a)read() to accept the radius from user.
b)compute() for calculating the area
c)display() for displaying the result.(Use Scope resolution operator)

Answer:


2. Define a class complex with data members real and imaginary, member function read() and write(). Write a program to perform the addition of two complex number and display the result.

Answer:


3. Complete the following table:

Answer:


Conclusion

In this 313304 OOP practical no.5, we write various C++ codes to define the function outside the class and execute them successfully.

About the Author

Hi everyone, I'm Suraj Diware, and I'm passionate about helping students succeed in MSBTE programs. This blog is dedicated to providing clear and concise explanations of MSBTE curriculum topics, along with practical tips and resources to sup…

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.