Professional Documents
Culture Documents
Assessment Type: Formative Assessments: Embedded Questions in Video
Assessment Type: Formative Assessments: Embedded Questions in Video
Assessment Type: Formative Assessments: Embedded Questions in Video
<Assessments>: <Formative>
<Chetashri Bhusari>
Which symbol is used for scope Which keyword is used to declare Inline function required how many lines
of code in member function declaration?
resolution operator? online keyword?
a) : a) inline a) one
b) :: b) outside b) two
C) :; c) three
d) .
a) same a) same
b) separate b) separate
Ans:b Ans:a
If students have access to laptop/ desktop – they can answer it on LMS, else download it and answer it and file
it for later use. They can also copy the question in their notebook in case the space provided is insufficient.
A. List characteristics of member function. B. Give two places where we can declare
member function in a class.
●
C. Write down syntax of outside member D. Write a program to declare a class ‘emp’
function declaration syntax. containing data member’s emp_id and
salary. Accept and display this data for 1
object of the class.(Inside member function
declaration)
C. Answer D . Answer
#include<iostream>
Return- data-Type class-name :: function- using namespace std;
name (argument –declaration) class Emp
{
{
private:
function Body int emp_id;
float salary;
} public:
● The membership label ‘class-name:: ‘ void accept()
tells the compiler that the function {
belongs to the spiffed class. cout<<"\n Enter Employee id : ";
cin>>emp_id;
● The symbol “::” is called scope resolution cout<<"\n Enter Salary : ";
operator cin>>salary;
}
void showdata()
{
cout<<"\n Employee id is "<<emp_id;
cout<<"\n Employee salary is :
"<<salary;
}
};
int main()
{
Emp e;
e.accept();
e.showdata();
}
Output:
Output Executed with dev c++
E. EWrite a program to declare a class ‘emp’ F. Write short note on Inline function
containing data member’s emp_id and
salary. Accept and display this data for 1
object of the class.(Outside Member
function declaration)
function Body
Example:
{
return ( a * a * a);