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

  Concept of object-oriented programming

Determine the manner in which each of the provided concepts relates to the concept of object-oriented programming. Justify your response - Analyze the fundamental manner in which they each relate to C++ coding of programs.

  Define a static method samecolor in the car class

Write an abstract class Car to implement the Comparable interface. Write a Truck class and a Sedan class to implement Car. define a static method sameColor in the Car class to find out weather a Truck and a Sedan has the same color.

  Program that computes the monthly loan payment

Write a program that computes the monthly loan payment, given the loan amount (a double value), the interest, as a percent % (a double value), and the number of years to repay the loan

  Write a driver program called testrationalnumber.cpp

Write a driver program called testRationalNumber.cpp to test each of the above functions and overloaded operators in the RationalNumber class.

  Display the current date and time in a human-readable format

The command "date" will display the current date and time in a human-readable format. Display the absolute pathname of the current working directory.

  The function should accept the future value

The function should accept the future value, annual interest rate, and number of years as arguments. It should return the present value, which is the amount that you need to deposit today. Demonstrate the function in a program that lets the user expe..

  Create a 1-dimensional (1d) array

Write a program to create a 1-dimensional (1D) array that contains 15 characters and display to the screen a count of the occurrences of each of the vowels a, e, i, o, and u in the array.

  Pairs of equivalent english spanish words

Create a program to implement a bi-lingual dictionary.set up an array to contain pairs of equivalent english spanish words.When an english word is input, looks up its spanish equivalent and display it.

  Design in c a unix utility program gasp

Design in C a Unix utility program gasp. Command gasp [options] STRING FILE... must read listed files (FILE...) and copy each line from input to stdout if it contains STRING.

  Analyze a basic set of requirements for a problem

Create the main bank program. Note that you can create the main bank program in the main function or you can try to create another class for the main bank program.

  C++ program to calculate the temperature

Randomly generates the daily temperature (in F) of two cities A and B the month of July. The temperatures are integers in the range [60.. 90] and they are stored in two arrays tA and tB.

  Your program should include two functions

Your program should include two functions. Function celsius_at_depth should compute and return the Celsius temperature at a depth given in kilometers. Function fahrenheit should convert a Celsius temperature to Fahrenheit.

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