Posts

Imagine a publishing company which does marketing for book and audiocassette versions. Create a class publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: book, which adds a page count (type int), and tape, which adds a playing time in minutes (type float).Write a program that instantiates the book and tape classes, allows user to enter data and displays the data members. If an exception is caught, replace all the data member values with zero values.

Class:-SE Computer OOP & CG Practical Title:-Imagine a publishing company which does marketing for book and audiocassette versions. Create a class publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: book, which adds a page count (type int), and tape, which adds a playing time in minutes (type float).Write a program that instantiates the book and tape classes, allows user to enter data and displays the data members. If an exception is caught, replace all the data member values with zero values.

Develop an object oriented program in C++ to create a database of student information system containing the following information: Name, Roll number, Class, division, Date of Birth, Blood group, Contact address, telephone number, driving license no. etc Construct the database with suitable member functions for initializing and destroying the data viz constructor, default constructor, Copy constructor, destructor, static member functions, friend class, this pointer, inline code and dynamic memory allocation operators-new and delete.

Class:-SE Computer  OOP & CG Practical Title : - Develop an object oriented program in C++ to create a database of student information system containing the following information: Name, Roll number, Class, division, Date of Birth, Blood group, Contact address, telephone number, driving license no. etc Construct the database with suitable member functions for initializing and destroying the data viz constructor, default constructor, Copy constructor, destructor, static member functions, friend class, this pointer, inline code and dynamic memory allocation operators-new and delete.

Implement a class Complex which represents the Complex Number data type. Implement the following operations: 1. Constructor (including a default constructor which creates the complex number 0+0i). 2. Overloaded operator+ to add two complex numbers. 3. Overloaded operator* to multiply two complex numbers. 4. Overloaded << and >> to print and read Complex Numbers.

Class:-SE Computer  OOP & CG Practical Title :-  Implement a class Complex which represents the Complex Number data type. Implement the following operations: 1. Constructor (including a default constructor which creates the complex number 0+0i).  2. Overloaded operator+ to add two complex numbers.  3. Overloaded operator* to multiply two complex numbers.  4. Overloaded << and >> to print and read Complex Numbers.

Pyramid Star Pattern....

Image
 

Conditional Statements in C - Hacker Rank Solution

Image
  Objective if  and  else  are two of the most frequently used conditionals in C/C++, and they enable you to execute zero or one conditional statement among many such dependent conditional statements. We use them in the following ways: if : This executes the body of bracketed code starting with   if   evaluates to  true . if (condition) { statement1; ... } if - else : This executes the body of bracketed code starting with   if   evaluates to  true , or it executes the body of code starting with   if   evaluates to  false . Note that only  one  of the bracketed code sections will ever be executed. if (condition) { statement1; ... } else { statement2; ... } if - else if - else : In this structure, dependent statements are chained together and the   for each statement is only checked if all prior conditions in the chain are evaluated to  false . On...

Pointers in C - Hacker Rank Solution

Image
  Objective In this challenge, you will learn to implement the basic functionalities of pointers in C. A  pointer  in C is a way to share a memory address among different contexts (primarily functions). They are primarily used whenever a function needs to modify the content of a variable that it does not own. In order to access the memory address of a variable,  , prepend it with   sign. For example,  &val  returns the memory address of  . This memory address is assigned to a pointer and can be shared among various functions. For example,   will assign the memory address of   to pointer  . To access the content of the memory to which the pointer points, prepend it with a  * . For example,  *p  will return the value reflected by   and any modification to it will be reflected at the source ( ). void increment ( int * v ) { ( * v ) ++ ; } int main () { ...