Write a class name circle

Assignment Help Basic Computer Science
Reference no: EM13975886

Circle Class. Write a class name Circle, with the class declaration in a file called Circle.h and the implementation in a file called Circle.cpp. The class will have two data members, a double that holds the radius of the circle and a double called pi which will be set to the value, 3.14159 (data member cannot be set in the class declaration, pi should not be set via a parameter but set in the constructor). The class must provide the following member functions

  • Default Constructor - that sets the radius to 0.0
  • Constructor - that accepts the radius of the circle as an argument
  • setRadius - a mutator function for the radius variable
  • getRadius - an accessor function for the radius variable
  • getArea - calculates and returns (as double) the area of the circle using the formulaarea = pi * radius * radius
  • getDiameter - calculates and returns (as double) the diameter of the circle using the formuladiameter = radius * 2
  • getCircumference - calculates and returns (as double) the circumference of the circle using the formulacircumference = 2 * pi * radius

Write a program that demonstrates the Circle class by asking the user for the circle's radius and creating a Circle object and then reporting the circle's area, diameter and circumference. Two objects need to be created each using one of the two constructors (showing that both work along with the mutators and accessors).

Reference no: EM13975886

Questions Cloud

Prepare ahistogram for the data on high temperatures : Prepare a data spreadsheet with three columns: Date, High Temperature, and Low Temperature. List the past 60 days for which data is available. Prepare ahistogram for the data on high temperatures and comment on the shape of the distribution as ob..
What distance from the object should the lens be placed : You need to use a 21-cm-focal-length lens to produce an inverted image one third the height of an object. At what distance from the object should the lens be placed? Express your answer to two significant figures and include the appropriate units.
Apriori algorithm makes use of prior knowledge of subset : 1.The Apriori algorithm makes use of prior knowledge of subset support properties:  a. Prove that all nonempty subsets of frequent itemsets must also be frequent?  b. Prove that the support of any nonempty subset s' of itemset s must be at least as g..
Compute the mean and median : The file MobileLoyaltycontains spending on products ($) during a three-month period by a sample of 15 customers receiving incentives through a mobile loyalty program. Compute the mean and median. Compute the variance, standard deviation, range, and..
Write a class name circle : Circle Class. Write a class name Circle, with the class declaration in a file called Circle.h and the implementation in a file called Circle.cpp. The class will have two data members, a double that holds the radius of the circle and a double called p..
Using a loop, multiple all of the numbers between 3 and 10. : Using a loop, multiple all of the numbers between 3 and 10.
Which attack exploits the session initiation : Which  attack exploits the session initiation between the Transport Control Program (TCP) client and server in a network?
Is there are way to split a large file : Is there are way to split a large file (around 7Gb) without completely reading it. Can we somehow take advantage of the  values stored in the internal map structures?
What are the cosmological implications of these oscillations : Why does the oscillation of neutrinos directly imply that they must have a nonzero mass, since the passage of one flavor to another can only occur in massive particles? And What are the cosmological implications of these oscillations?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Hat does mbsa do to check for weak local account passwords

hat does MBSA do to check for weak local account passwords?

  Develop a wbs for the process for recovering your computer

Develop a WBS for the process for recovering your computer. Estimate the time it will take you to perform each task.

  Four techniques for analyzing

Briefly compare and contrast the four techniques for analyzing the costs and benefits of a proposed system. What do you see as particular strengths and weakness of each method?

  Study evidence for defence in law firm

You are engaged by law firm to study evidence for the defence. You uncover evidence that doesn't help your client's case but was not discovered by the prosecution.

  Describe how you have represented super type

Convert this data model to a database design. Specify tables, foreign keys and primary keys, using figure 6-41 as a guide, specify column properties.

  Collaboration and social media

While planning for a new project, a young developer mentions that she used Facebook as a collaborative group space for developing her senior project. She tells you that it was the ideal solution since it was free and all of her group members were ..

  New information technology system

Present a new system proposal for the Riordan manufacturing organization. Riordan is a virtual organization. Write a paper of minimum 2 pages that includes the following:

  Follow the steps below

Follow the steps below. If you make an error, use the UNDO button to undo the error.

  Ip addresses could not be assigned to the router

IP addresses could not be assigned to the router's Fa0/0 interface?

  What ways itplanning help managers control situation

In what ways does IT planning help managers exercise control in a situation? Does IT impact the truck driver of a company who delivers supplies to its customer

  Create a console application

Create a console application

  Examine the specifications for an enterprise class firewall

Examine the specifications for an enterprise class firewall and a personal or home firewall. Determine why all firewalls are not equal. Assess the effectiveness of each and determine if one outperforms another at its intended function.

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