Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Q2: Answer the questions (i) and (iii) after going through the following class:
class Seminar
{
int time;
public:
Seminar() //Function 1
{
time = 30;
cout << "Seminar starts now" << endl;
}
void lecture() //Function 2
{
cout << "Lectures in the seminar on" << endl;
}
Seminar(int duration) //Function 3
{
time = duration;
cout << "Seminar starts now" << endl;
}
~Seminar() //Function 4
{
cout << "Thanks" << endl;
}
};
i. Write statements in C++ that would execute Function 1 and Function 3 of class Seminar.
ii. In Object Oriented Programming, what is Function 4 referred as and when does it get invoked/called?
iii. In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together?
Q2: Answer the questions (i) to (iv) based on the following:
class Publisher
{
char pub[12];
double turnover;
protected:
void register();
public:
Publisher();
void enter();
void display();
};

class Branch
{
char city[20];
protected:
float employees;
public:
Branch();
void haveit();
void giveit();
};

class Author : private Branch, public Publisher
{
int acode;
char aname[20];
float amount;
public:
Author();
void start();
void show();
};
i. Write the names of data members, which are accessible from objects belonging to class Author.
ii. Write the names of all the member functions which are accessible from objects belonging to class Branch.
iii. Write the names of all the members which are accessible from member functions of class Author.
iv. How many bytes will be required by an object belonging to class Author?
Q2: Answer the questions (i) to (iv) based on the following:
class Publisher
{
char pub[12];
double turnover;
protected:
void register();
public:
Publisher();
void enter();
void display();
};

class Branch
{
char city[20];
protected:
float employees;
public:
Branch();
void haveit();
void giveit();
};

class Author : private Branch, public Publisher
{
int acode;
char aname[20];
float amount;
public:
Author();
void start();
void show();
};
i. Write the names of data members, which are accessible from objects belonging to class Author.
ii. Write the names of all the member functions which are accessible from objects belonging to class Branch.
iii. Write the names of all the members which are accessible from member functions of class Author.
iv. How many bytes will be required by an object belonging to class Author?
Q1: Consider the following declarations and answer the question given below :
class Vehicle
{
private:
int wheels;
protected :
int passenger:
public :
void inputdata(int, int);
void outputdata();
};

class Heavyvehicle : protected Vehicle
{
int diesel_petrol;
protected :
int load;
public:
void readdata(int, int);
void writedata();
};

class Bus : private Heavyvehicle
{
char make[20];
public :
void fetchdata(char);
void displaydata();
};

(i) Name the base class and derived class of the class Heavyvehicle.
(ii) Name the data member(s) that can be accessed from function displaydata().
(iii) Name the data member's that can be accessed by an object of Bus class.
(iv) Is the member function outputdata() accessible to the objects of Heavyvehicle class.
Q1: Consider the following declarations and answer the question given below :
class Vehicle
{
private:
int wheels;
protected :
int passenger:
public :
void inputdata(int, int);
void outputdata();
};

class Heavyvehicle : protected Vehicle
{
int diesel_petrol;
protected :
int load;
public:
void readdata(int, int);
void writedata();
};

class Bus : private Heavyvehicle
{
char make[20];
public :
void fetchdata(char);
void displaydata();
};

(i) Name the base class and derived class of the class Heavyvehicle.
(ii) Name the data member(s) that can be accessed from function displaydata().
(iii) Name the data member's that can be accessed by an object of Bus class.
(iv) Is the member function outputdata() accessible to the objects of Heavyvehicle class.
Q2: Answer the questions (i) and (iii) after going through the following class:
class Seminar
{
int time;
public:
Seminar() //Function 1
{
time = 30;
cout << "Seminar starts now" << endl;
}
void lecture() //Function 2
{
cout << "Lectures in the seminar on" << endl;
}
Seminar(int duration) //Function 3
{
time = duration;
cout << "Seminar starts now" << endl;
}
~Seminar() //Function 4
{
cout << "Thanks" << endl;
}
};
i. Write statements in C++ that would execute Function 1 and Function 3 of class Seminar.
ii. In Object Oriented Programming, what is Function 4 referred as and when does it get invoked/called?
iii. In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together?

Find and display the values of both sides of the following mathematical series expression and

an absolute difference of both sides. User can input either of angles in degree 90, 60, 30 etc.

sin(x) = x - ((x^3)/3!)+((x^5)/5!)-((x^7)/7!)+((x^9)/9!)


Once the user enters the angle in degrees. Your program should do the following (Write separate

functions for a, b, c, and d)

a) LHS Result

b) RHS Result

c) Difference

d) First term, series of two terms, series of three terms, series of four terms, series of five terms.


Write C++ program: Lets create your first cipher!!! Cipher is an algorithm that you can use to encrypt and decrypt sensitive information. In an information system, sensitive information is stored in a 16-bit unsigned number, where bit-wise information is stored in following format, 9-bits are reserved for account number and 7-bits are reserved for customer ID.


15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

C C C C C C C A A A A A A A A A


a) Using bit wise operators, write a function to extract customer ID

b) Another function to extract account number.

c) Due to security concerns, you have been given a task to create a cipher. Write a function to encrypt the 16-bit number (X) using the following expression.

y = aX + b, consider a = 5 and b = 233


d) Write another function to decrypt the number and display the original number.


Write a C++ program to Find and display the values of both sides of the following mathematical series expression and an absolute difference of both sides. User can input either of angles in degree 90, 60, 30 etc.

sin(x) = x − (x^3 / 3!) + (x^5 / 5!) − (x^7 / 7!) + (x^9 / 9!)

Once the user enters the angle in degrees. Your program should do the following (Write separate functions for a, b, c, and d)

a) LHS Result

b) RHS Result

c) Difference

d) First term,

series of two terms, series of three terms, series of four terms, series of five terms.


How to display the product of numbers divisible by 4 from 4 to 50 using do while loop


LATEST TUTORIALS
APPROVED BY CLIENTS