1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Juliette [100K]
3 years ago
10

Write a class declaration named Circle with a private member variable named radius. Write set and get functions to access the ra

dius variable, and a function named getArea that returns the area of the circle. The area is calculated as: 3.14159 * radius * radius
Computers and Technology
1 answer:
Kazeer [188]3 years ago
4 0

Answer:

See explaination

Explanation:

#include <iostream>

using namespace std;

class Circle{

// private member variable named radius

private:

double radius;

// get function for radius

public:

double getRadius(){

return radius;

}

// set function for radius

void setRadius(double rad){

radius=rad;

}

// returning area = 3.14159 * radius * radius

double getArea(){

return (3.14159 * radius * radius);

}

};

// Sample run

int main()

{

// Declaring object of Circle

Circle myCircle;

myCircle.setRadius(5);

// printing radius of circle

cout<<"Radius of circle is: "<<(myCircle.getRadius())<<endl;

// printing area of circle

cout<<"Area of circle is: "<<(myCircle.getArea())<<endl;

return 0;

}

You might be interested in
What type of micro sd card is needed for this type of MP3 player? I tried searching it up and a bunch came up. I don’t know whic
zaharov [31]
A regular micro sd, they offer different amounts of storage
8 0
3 years ago
With the Linux operating system, its open source design means it can be used, modified and ______
nadya68 [22]

Answer:

distributed.

Explanation:

Because Linux is released under an open source license, which prevents restrictions on the use of the software, anyone can run, study, modify, and redistribute the source code, or even sell copies of their modified code, as long as they do so under the same license.

3 0
3 years ago
Mike wants to build an amplifier. which technology can he use?
STatiana [176]
A.
Not B because a guitar has no moving parts.
Not C because guitars receive all the power they need from a cord.
And not D because a guitar is not a car and doesn't need to move!
4 0
3 years ago
Give three reasons to use a hard drive as mass storage.
serious [3.7K]

Answer:

Every computer – whether it's a tower desktop or laptop – is equipped with an internal hard drive. The hard drive is where all your permanent computer data is stored. Whenever you save a file, photo, or software to your computer, it's stored in your hard drive

Explanation:

Backups and Archives. ...

Media Libraries. ...

Large Capacity Storage. ...

NAS Drives and Security. ...

RAID Arrays. ...

Other Uses.

8 0
3 years ago
To create an instance of Big Decimal for 454.45, use ________.
agasfer [191]

Answer:

C.

Explanation:

Based on the Java documentation; when creating an instance of BigDecimal, we can pass a string as a constructor.

System.out.println(new BigDecimal("454.45"));

8 0
4 years ago
Other questions:
  • HELP ASAP!!!! PLEASE !!! What information does the Media Access Control (MAC) on a network card provide?
    9·2 answers
  • The number of credits awarded for the CLEP exam is determined by__<br> Help pls!
    15·1 answer
  • Spreadshet formula to add totals​
    12·1 answer
  • Binary data is written in hexadecimal. For example, when creating a graphic for a website, colors are represented by six hexadec
    12·1 answer
  • The best way to insert an existing Excel chart into a document is to
    12·2 answers
  • You notice your glove is torn; what should you do
    14·2 answers
  • A system administrator suspects that there is an error in the replication configuration. How can the system administrator look f
    7·1 answer
  • How can you say that a computer is a versatile machine?​
    7·1 answer
  • If we ignore the audio data in a video file, a video file is just a collection of many individual frames (i.e., images). What is
    6·1 answer
  • Which best describes sorting, filtering, and deleting records?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!