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

Questions Cloud

Calculate the internal energy change for vaporization : Calculate the internal energy change (deltaU) for vaporization of 100 g of Cl2(liq.) at this temperature and 1 bar? (b) Calculate its molar entropy change (AS) for vaporization at this condition
What is the number of moles of gas : If 20.0L of neon gas exerts a pressure of 125 psi at 423 k , what is the number of moles of gas?
What factors might decrease pool of oxaloacetate available : What factors (or metabolic conditions) might decrease the pool of oxaloacetate available for the activity of the citric acid cycle?
Adjusting entries for the month : The office equipment has a 5-year life with no salvage value. It is being depreciated at $295 per month for 60 months. Invoices representing $1,005 of services performed during the month have not been recorded as of June 30. (a) Prepare the adjusting..
Create a class called point3d : 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 he..
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.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program in c that will find smallest value

Write a programe c that will find the smallest, largest and average values in a collection of N numbers.Get the value of N before scanning each value in the collection of N numbers.

  Program which asks the user for due date of next assignment

Write a program which asks the user for due date of the next assignment (hours, minutes). Then print number of minutes between the current time and the due date in format.

  Write a program that converts between app and ppm values

Write a simple program that converts between APP and PPM values

  Write c program for linked list applications

Write a complete C program which illustrates the Linked list applications data structures and algorithms. The program will read in mid-semester test scores as Main Linked List and produce six outputs:

  Write a program to calculate students average test scores

Write a program to calculate students average test scores

  Write c program which has parent process and child process

Write a C program that has a parent process, a child process, and a grandchild process. The parent process should print its id and the square or 5.

  Program to compute diameter in centimeters of a steel rod

Write a program to compute the diameter in centimeters of a steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

  Smallest sequence of numbers in the array

Write a function called sum_smallest_sequence() that accepts an array of  signed  integers and the  number  of items in the array as arguments, and returns the sum of the smallest sequence of numbers in the array.

  Determine order in which constructors of class will execute

Suppose that an object of class three enters its scope, so the constructors of theses classes will execute. Determine the order in which the constructors of these classes will execute.

  Public transport fare ticketing system

Implement and test a public transport fare ticketing system.

  Main function to input twenty integers in given range

Write a main function to input 20 integers in range of 1-6, function should count number of times the numbers 2 and 5 occur. function must declare statics variables count2 and count5.

  Program to store lists of names and ages in parallel arrays

Write a C++ program that stores lists of names (the last name first) and ages in parallel arrays and sorts the names into alphabetical order keeping the ages with the correct names.

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