Programs written with inheritance

Assignment Help C/C++ Programming
Reference no: EM13161011

Create a class called Point3D to represent 3D point in space, a class called Sphere and a class called Cylinder. The sphere is characterized by its center point and the radius while the Cylinder can be characterized by its center point, radius and height..

In your design provide a constructor for each class that enables an object of this class to be initialized when it is declared. The constructor should contain default values in case no initializers are provided. Provide public member functions to set/get private data members, to calculate the surface area and the volume for each class in the hierarchy. You must write you code in two different approaches:

  1. Incorporate inheritance to implement the class hierarchy for the three classes Point3D, Sphere and Cylinder using inheritance.
  2. Many programs written with inheritance could be written with composition instead, and vice versa. Rewrite the classes Point3D, Sphere and Cylinder using composition rather than inheritance

Reference no: EM13161011

Questions Cloud

Desktop publishing system : Consider a desktop publishing system used to produce documents for various organizations. a. Give an example of a type of publication for which confidentiality of the stored data is the most important requirement
Write a program to find that number for nguyen. : In some Asian countries, 8 and 6 are considered lucky digits. Any number containing only 8s and 6s is considered lucky number, e.g. 6, 8, 66, 668, 88, 886 .... Nguyen is a student who likes mathematics very much. Nguyen likes lucky numbers but only o..
Register address machine : Express the statement X= (A*B)-(C*D)-E in the assembly language of each of 0- memory address machine, 3-register address machine with 3 registers R1,R2,R3, and 2-memory-register-address machine with three registers R1,R2, R3. Your solution should use..
Competitive strategy - milk industry : Choose a global business form the - Milk industry and Woolworths and Coles operating overseas markets
Programs written with inheritance : Many programs written with inheritance could be written with composition instead, and vice versa. Rewrite the classes Point3D, Sphere and Cylinder using composition rather than inheritance
What is the probability : Suppose that the four inspectors at a film factory are supposed to stamp the expiration date on each package of film at the end of the assembly line. John, who stamps 20% of the package, fails to stamp the expiration date once in every 200 package.
Experience differentiation : Experience Differentiation-   isolates the consumer from the delivery of a service.  is an extension of product differentiation in the service sector
Boot process for a windows machine : What is the boot process for a Windows machine switches through several different modes. What are they, and how do they impact security?
Interpersonal relationships : What type of power is typically exercised within interpersonal relationships?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Array of integers declared-initialized to number of tickets

Array of integers named parkingTickets has been declared and initialized to number of parking tickets given out by city police each day as beginning of current year.

  Write program to input series of hourly temperatures

Create and write a c++ program which inputs series of 24 hourly temperatures from file, and outputs bar chart (using stars) of temperatures for the day.

  You will create a linked list module

You will create a linked list module that exactly meets the specifications given in the supplied header (.h) file. The playlist program must accept a filename on the command line (argv).

  Public transport fare ticketing system

Implement and test a public transport fare ticketing system.

  Design a class named employeerecord

Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that

  Struct complex

A complex number can be represented by two parts, real and image. A series complex data can be organized as a group of elements by linked list, which is shown as below: struct Complex

  Write function to find whether number is perfect number

Write down the function perfect which determines whether number is perfect number or not. This function must receive number and return true if number is perfect.

  Prepare the weighted scoring model for three exams

Prepare the weighted scoring model. Final grades are based on three exams worth 15%, 20%, and 25%, respectively; homework is worth 20%.

  Create a text adventure game that uses pointers

Create a text adventure game that uses pointers. You have a rich, eccentric Uncle Billy who is soon to be deceased.

  If a class is derived protected

If a class is derived protected from a base class, explain how this affects the inheritance of all public, protected, and private members of the base class by the derived class.

  Prepare a program that uses the pthread library

Prepare a C/C++ program that uses the PTHREAD library to create threads and mutexes to synchronize them.

  Create program to input miles driven and gallons used

Create a program in C++ which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and display the miles per gallon

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd