Create a class called point3d

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

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: EM13158500

Previous Q& A

  Characteristics of project life cycle

All of the following are common characteristics of project life cycle descriptions except: Cost and staffing levels are low at the start, higher towards the end and drop rapidly as the project ends

  Write a recursive method to produce a pattern

Write a recursive method to produce a pattern of n lines of asterisks.

  Compute the change in entropy

Calculate the change in entropy (deltaS) when one mole of diamond is heated from a temperature of 0 K to 400 K at a constant pressure of 1 bar. The temperature-dependent heat capacity of diamond is Cv

  Different aspects of religion

Examine how each of the three theoretical approaches directs toward different aspects of religion. Provide examples of how religion has promoted dramatic social transformation.

  What is the resulting average emf induced in the coil

the area of the coil is perpendicular to the magnetic field lines, what is the resulting average emf induced in the coil? Any help is appreciated!

  Domestic human resource management

How does global human resource management differ from domestic human resource management?

  What is the income gap for the bank

What is the income gap for the bank? What will happen to profits next year if interest rates fall by 3 percentage points?

  Warranty expense or liability

1. How much warranty expense should the company report in 2011 for this computer? 2. How much is the warranty liability for this computer as of Dec 31, 2011?

  Acrylic acid soluble as acetic acid in water

A trayed column is used to recover acrylic acid and acetic acid from a dilute gas stream by absorption in water. At the same vapor concentration, acrylic acid is about two times as soluble as acetic acid in water

  What was the mass % of d2o in the original sample of water

A 1.00 g sample of enriched water, a mixture of H2O and D2O, reacted completely with Cl2 to give a mixture of HCl and DCl. The HCl and DCl were then dissolved in pure H2O to make a 1.00 L solution


Write a Review


Similar Q& A

  Prepare a linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM

  Write program to perform add-drop-list and update functions

Write C++ program to do add, drop, list (in last name / first name sorted order or id) and update functions. separate UI from data processing use object programming method multiple files

  Prepare a program for a retail-mart company

Prepare a program for a company Retail-Mart.

  Calculate the net pay as the gross less the taxes

Design and code a new function that accepts as parameters the gross pay by value and the federal tax, state tax, local tax, SS tax, and net Pay by reference.

  Construct vector and linked lists data structures

You will prepare sorted versions of the Linked Lists and Vector data structures developed in class

  Design customized mailing lists for marketing department

Marketing department requires to be able to design customized mailing lists, to send different messages to different types of donors. What system will best meet these requirements?

  Calculate the component voltages

Calculate the component voltages for the following series resonant RLC circuit

  Write main function to compute stress-strain in steel rod

Write a main function and the following functions to compute the stress and strain in a steel rod of diameter D (inches) and length L (inches) subject to the compression loads.

  Design a nested program

How many levels of nesting are there in this design?

  Write test program to call function several times for gcd

Greatest common divisor of two integers is largest integer which will evenly divide both integers. Implement this function in assembly language and write test program which calls function several times, passing it different values.

  Write program to count occurrences of each word in text

Write down C++ program to read following text. Count occurrences of each word in text and keep this count in list of elements containing (word, occurrence count) pairs.

  Program to print out invalid number to character

The integer must contain 3 distinct non-zero number, or the program will print out invalid should print out invalid query.

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