Q2. Write a program to define four structures with structure variable of array types. Enter data into each structure variable that has four records and each record contains five fields.
. Write a program to initialize the data members through passing two parameters using a constructor. Calculate their sum and print the output on the screen using a separate member function of a class.
· Implement the following hierarchy.
· Make Shape, TwoDimensionalShape, and ThreeDimensionalShape as abstract class
· Add virtual functions of calculateArea() and perimeter() in TwoDimensionalShape.
· Implement the above functions in child classes Circle, Square , Triangle. Take help from Google to find the formulas.
· add virtual functions of calculateSurfaceArea() and calculateVolume() in ThreeDimensionalShape
Implement all functions in child classes Sphere, cube, and tetrahedron.
sales management system project code in c++ by using oop.its use class, inheritance and function?
write a class circle with one protected data member radius. Write three member function set radius to set radius value with parameter value area to display area and circum to calculate and display circumfance of circle
write a program to print a star
*
**
***
****
****
using for next statement
write a code which displays the amount of movies ticket bought by the customer and the seat number .write using functions
Following is the a simple diagram for a class hierarchy of an employee, you are required to map the
diagram to C++ Code , Each class should have a default and an overloaded constructor and a function
named as SalaryCalculator() which calculates the pay according to the employee the employer have.
Parent class :Employee
Employee child classes:
1)SalariedEmployee
2)CommissionEmployee
3)HourlyEmployee
Employee and CommissionEmployee child class:
1)Base plus Commission Employee
Implement:
Inheritance
Dynamic Polymorphism
A main( ) which can test all the classes
Design a software system for FESCO-WAPDA for 2014 from which they calculate the monthly bill of
Electricity.
Write a class Bill having the following attributes and behavior
Int Units
Int per_unit_cost
Float bill
Pure virtual functions:
Monthly_bill()
Bill_display()
Derived the following classes from the base class Bill:
January_bill
February_bill
March_bill
April_bill
Perform the functionality:-
Calculate the monthly bills for every month.
Show the results on the console using Display () function.
Write destructor when you realize that this is the end of program.
Use virtual destructor concept in the above hierarchy.
Note:
Use virtual Member functions for derived classes.
Use appropriate values for per unit cost of monthly bills.
User appropriate data types.
Write a function that takes three int parameters a, b, c and returns the median of
the three numbers..