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

  Components of a warehouse management system

components of a warehouse management system

  Major steps of the process maria will have to oversee

Which documents should Maria read before her class? Based on what you know about ISO 27000 program certification, what are the major steps of the process Maria will have to oversee?

  Network security and the internet

The general area of network security is obviously of enormous corporate and national importance. And there's no doubt that intrusion detection and prevention is a principal concern. Lately there have been a number of concerted security attacks on ..

  Internet through the creation of a basic eportfolio

Create a presence on the Internet through the creation of a basic ePortfolio. The Portfolio should be three pages at a minimum and include:

  Implement a simple menu-driven text adventure

For this assignment you will be provided with incomplete sample starter code that you can modify and build upon. Your task will be to carry out the design, analysis, coding and testing to add several additional features to this sample code. You ar..

  It architecture or enterprise architecture on information

Ascertain the importance of information management for the company or industry that you have chosen.Analyze the fundamental impact of IT architecture or enterprise architecture on information management for your chosen company or industry. Determine ..

  Write a class called checkingaccount

Write a class called CheckingAccount that has the following fields and methods.

  Sunshine machine works has expanded its infrastructure

Since you are responsible for IT Services and want to keep the systems and network functioning effectively, you will want to identify activities which would be permitted and which activities would be prohibited. Management will take your policy..

  What is the result of issuing 0x08 function code

In a SCADA system, what is the result of issuing 0x08 function code followed by a 0x01 subfunction code on a slave using Modbus?

  Design a nine-step counter to count

Design a nine-step counter to count in the following sequence using D flip-flops (TTL 74704) on a breadboard

  Program for an automatic teller machine

Create a program for an automatic teller machine that dispenses money. The user should insert amount desired and the machine dispenses this amount using least number of bills.

  Design patterns in today-s development environments

In System Analysis and Design: Design Patterns - How widely used are design patterns in today's development environments?

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