Provide a three-argument constructor

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

Question: Create a class called Point that has two data members: x- and y-coordinates of the point. Provide a no-argument and a 2-argument constructor.

Provide separate get and set functions for the each of the data members i.e. getX, getY, setX, setY.

The getter functions should return the corresponding values to the calling function. Provide a display method to display the point in (x, y) format. Make appropriate functions const.

Derive a class Circle from this Point class that has an additional data member: radius of the circle. The point from which this circle is derived represents the center of circle. Provide a no-argument constructor to initialize the radius and center coordinates to 0. Provide a 2-argument constructor: one argument to initialize the radius of circle and the other argument to initialize the center of circle (provide an object of point class in the second argument). Provide a three-argument constructor that takes three floats to initialize the radius, x-, and y-coordinates of the circle. Provide setter and getter functions for radius of the circle. Provide two functions to determine the radius and circumference of the circle.

Write a main function to test this class

Reference no: EM13719058

Questions Cloud

The rate of entropy production within the duct, : Air at 300 kPa, 63oC, and a velocity of 423 m/s enters an insulated duct of varying cross-sectional area. The air exits at 150 kPa, 88oC. At the inlet, the cross-sectional area is 6.57 cm2. Assuming the ideal gas model for the air and variable specif..
Determine the quality of the steam at the turbine exit : Steam at 550 lbf/in.2, 700oF enters a turbine operating at steady state and exits at 1 lbf/in.2. The turbine produces 500 hp. For the turbine, heat transfer is negligible as are kinetic and potential energy effects.
Determine the amount of entropy produced : Air contained in a rigid, insulated tank fitted with a paddle wheel, initially at 4 bar, 40oC and volume of 0.2 m3, is stirred until its temperature is 500 K. Assuming the ideal gas model for the air, determine the amount of entropy produced, in kJ/K..
Evaluate the average force exerted on the car : A car crashes into a wall. You are given the mass, initial velocity and compression of the car. evaluate the average force exerted on the car
Provide a three-argument constructor : Create a class called Point that has two data members: x- and y-coordinates of the point. Provide a no-argument and a 2-argument constructor - Provide a three-argument constructor
Evaluate the thickness of the oil film : A film of oil that has an index of refraction of 1.45 rests on an optically flat piece of glass of index of refraction n = 1.60. Determine the thickness of the oil film
Determine the magnitude of the average force : A 67.6 kg person jumps from rest off a 2.91 m-high tower straight down into the water. Neglect air resistance during the descent. Determine the magnitude of the average force
Thin-walled tube has plastic anisotropy : A drawn, thin -walled tube has plastic (orthotropic) anisotropy. The axial direction of the tube is similar to the rolling direction of anisotropic sheet metal. The tube diameter is 3 inches and the wall thickness is 0.040 inch.
Materials for competitive strategy : The second paragraph should identify an organisation which would benefit from the application of these ideas and explain how the ideas should be applied.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  In this assignment you have to implement and test a public

in this assignment you have to implement and test a public transport fare ticketing system. you will need to

  Implement the graphics portion of the assignment

Analyze a basic set of requirements for a problem - Compose basic C++ language programs

  Write a recursive function that takes a string

Write a recursive function that takes a string as a parameter and prints its reversal in the same function in C++

  Write a recursive void function

Write a recursive void function called rot at eLeft that rotates the first n integers in an array to the left. To rotate n items left, rotate the first n - 1 items left recursively, and then exchange the last two items. For example, to rotate the ..

  Write a menu-driven program that maintains an address book

Write a menu-driven program that maintains an address book using a linked list. The address book must supports the following operations

  Find the radius of the circle

The program should then output the circle's radius, circumference, diameter, and area. Your program must have at least the given methods - Find the radius of the circle, and returns the circle's radius.

  Write and run a c++ program that computes and displays

A machine purchased for $28,000 is depreciated at a rate of $4,000 a year for 7 years. Write and run a C++ program that computes and displays a depreciation table for 7 years.

  Write a function called distance

Write a function called distance that takes two Points as arguments and returns the distance between them.

  Write code that declares an int array named month

Write code that declares an int array named month with 5 rows and 7 coloumns and initializes every element to -1.

  Supposed to swap numbers

The program is supposed to swap numbers, but I am stuck something is wrong! It does not swap them it repeats the second number, please help to fix! Thanks, this is in C++.

  Two for loops that will calculate the sum of all even number

Write a program using two for loops that will calculate the sum of all even numbers between 2 and 100,

  Write a bouncing ball video game

The balls bounces within the screen where the two horizontal walls are fixed

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