Write three classes named point circle and cylinder

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

Assignment: Points, Circles, and Cylinders Requirements

Your task is to write three classes named Point, Circle, and Cylinder. Each should have a .h and a .cpp file. Point is the base class. Circle inherits from Point. Cylinder inherits from Circle. Each class needs a constructor and an overloaded insertion operator (<<).

The following main.cpp file:

#include <iostream>
#include "point.h"
#include "circle.h"
#include "cylinder.h"

using namespace std;

int main()
{
Point p(4,4); // x coordinate, y coordinate
Circle c(5,5,5); // x, y, radius
Cylinder y (6, 6, 6, 6); // x, y, r, height

cout << p << endl << endl;
cout << c << " " << endl << (Point) c << endl << endl;
cout << y << " " << endl << (Circle) y << " " << endl << (Point) y
<< endl << endl;

return 0;
}

produces this output:

Point at (4, 4)

Circle with center = (5, 5); Radius = 5; Area = 78.5397
Point at (5, 5)

Cylinder with center = (6, 6); Radius = 6; Height = 6; Volume = 678.583
Circle with center = (6, 6); Radius = 6; Area = 113.097
Point at (6, 6)

Submit 6 files (point.h, point.cpp, circle.h, circle.cpp, cylinder.h, and cylinder.cpp) combined as a single zip file. The graders will compile your source along with their main.cpp to test program functionality.

Reference no: EM131918554

Questions Cloud

How can cloud computing enhance business value : Compose a research paper by addressing the following research question: How can cloud computing enhance business value?
What is a corner point : What is a corner point? Why do solutions to linear-programming problems focus on corner points?
Facility layouts report : Facility Layouts Report Describe the following facility layout formats used in manufacturing:
Performance appraisal process of an organization : Select and briefly describe the training process and the performance appraisal process of an organization
Write three classes named point circle and cylinder : Write three classes named Point, Circle, and Cylinder. Each should have a .h and a .cpp file. Point is the base class. Circle inherits from Point.
Briefly outline each of the elements of customer value : Define Customer Value and briefly outline each of the elements of Customer Value (cost, time, place, form, experience, performance and problem solving).
What is statistical inference : What is statistical inference? What is the difference between and sample and a population? Which one is the basis of statistical inference?
How is fourth amendment applied to computer investigations : How is the Fourth Amendment applied to computer investigations? What problems might arise because of this Amendment?
What is impact of the fed policy on the equity market : What is the impact of the Fed Policy on the equity market (last 10 years, say)?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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