2. We want to keep track of Students studying in university. To do so create a class Students that has the following instance variables Reg_no, Name, Age, Address, Semester, CGPA and Fee. Where address is the object of address class and fee is same for all students.
The Student Class should have default constructor and augmented constructor. You need to write set() method to assign values to the instance variables and a method which can return grade using CGPA. You are required to create two objects of Student class and then display his Data along with grade.
Write a class Box with three variables length, width and height. Design suitable constructors, set and get functions. Write the main function and create the different objects of Box class. We want to count the objects of Box class what more you can add in your class to achieve the counting facility. Write the code and display the number of object created so far.
The following expression has a mistake
if{ x <= 0 }
Please provide the corrected version
Implement a program of maintaining banking account information system using multiple inheritance in C++ Programming. Here class savings derived from class account and class user. Use appropriate functions and variables
Write a program to calculate gross and net pay of employee from basic salary. Create employee class which consists of employee name, emp_id, and basic salary as its data members. Use parameterized constructor in the derived class to initialize data members of the base class and calculate gross and net pay of the employee in the derived class.
What number will the following code snippet print
double x = 3.5;
double y = 0;
if ( x <= 2 ){
y = 1;
}
else if( x <= 4){
y = 2;
}
else {
y = 3;
}
x = y;
cout << "Number:" << x << endl;
Please provide the numerical value of x which is printed at the end. This question will only accept numbers as answers.
The following expression has a mistake
if( x =! 0 )
Please provide the corrected version
Let’s implement the concept of doubly linked list with a real time example.
For a bogie we need following information:
struct bogie{
string Name;
char type; //B for Business Class, F for First Class, and E for Economy class
int capacity; //Between 50-70
int fare; //For Business Class 1200, For First Class 1000, For Economy class 500
bogie *next;
bogie *prev;
};
bogie *engine //use as head for the train
Define a class, name it Train and write following functions for that class:
i. Insert a bogie at front();
ii. Insert a bogie at given position() //position will be defined based on name of bogie
iii. Insert a bogie at the end()
iv. return seating capacity of each type()
v. return total number of seats()
vi. return maximum fare collection based on total capacity of train()
A BinaryStore calculator will store bytes “stored in strings” with their addresses, i.e., at each address in the BinaryStore there is a stored Byte. Each address will be 4 characters string and each byte will be 8 characters strings. Create a class BinaryStore and class Byte that offer following overloaded operators. class offers the following methods: an overloaded +=operator that will add the address in the list of BinaryStore an overloaded + that will add two string bytes for Byte Class an overloaded - that will subtract two string bytesByte Class an overloaded || operator that will give the string which is bit by bit logical or of act two string bytes for Byte Class an overloaded && operator that will give the string which is bit by bit logical and of act two string bytesfor Byte Class an overloaded == operator that will give bool value if they are equal or notfor Byte Class
Write C++ program by using while loop to display the following output
+---------+
| * |
| /*\ |
| //*\\ |
| ///*\\\ |
| \\\*/// |
| \\// |
| \*/ |
| * |
+---------+
| \\\*/// |
| \\// |
| \*/ |
| * |
| * |
| * |
| /*\ |
| //*\\ |
| ///*\\\ |
+---------+