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
lianna [129]
3 years ago
9

Write a program that prompts the user to enter the center and a point on the circle. The program should then output the circle’s

radius, diameter, circumference, and area. Your program must have at least the following functions: distance: This function takes as its parameters four numbers that represent two points in the plane and returns the distance between them.
Computers and Technology
1 answer:
sergij07 [2.7K]3 years ago
4 0

Here is the code in C++.

#include <bits/stdc++.h>

using namespace std;

// function to calculate distance between two points

double distance(int a,int b,int c,int d )

{

 // return the distance between center and point

  return sqrt(pow(c - a, 2) +

               pow(d - b, 2) * 1.0);

}

// driver function

int main()

{

// variables to store coordinates

int x1,y1,x2,y2;

cout<<"Please Enter the center(x y) of the circle: ";

//reading center

cin>>x1>>y1;

cout<<"\nPlease Enter a point(x1 y1) on the circle:";

//reading point

cin>>x2>>y2;

// calling distance() function with 4 parameters

double rad=distance(x1,y1,x2,y2);

// calculating Radius and print

cout<<"Radius of circle is: "<<rad<<endl;

// calculating Diameter and print

cout<<"Diameter of circle is: "<<2*rad<<endl;

// calculating Circumference and print

cout<<"Circumference of circle is: "<<2*3.14*rad<<endl;

// calculating Area and print

cout<<"Area of circle is: "<<3.14*rad*rad<<endl;

return 0;

}

Explanation:

First it will read coordinates of center and point on the circle.The distancebetween center and point on circle is Radius. Call distance() function withfour parameters which are coordinates of center and point. This will return the value of Radius. Diameter is 2 times of Radius.Diameter of a circle is 2*3.14*Radius. and Area of the circle is calculate as 3.14*Radius*Radius. After finding these value print them.

Output:

Please Enter the center(x y) of the circle: 0 0

Please Enter a point(x1 y1) on the circle: 3 4

Radius of circle is: 5

Diameter of circle is: 10

Circumference of circle is: 31.4

Area of circle is: 78.5

You might be interested in
What is the formula for calculating the average of cells<br> C2 through C30?
BARSIC [14]

For calculating the average of cells  C2 through C30 use the COMPUTE statement = AVERAGE(C2:C30).

Explanation:

  • Excel a software program created by Microsoft that uses spreadsheets to organize numbers and data with formulas and functions.
  • Excel analysis is ubiquitous around the world and used by businesses of all sizes to perform financial analysis.
  • The AVERAGE function calculates the average of numbers provided as arguments.
  • To calculate the average, Excel adds the numbers together and divides by the total number of values supplied. AVERAGE can handle up to 255 individual arguments, which can include numbers, cell references, ranges, arrays, and constants.
  • To perform the average formula in Excel, enter the values, cells, or range of cells of which you're calculating the average in the format, =AVERAGE(number1, number2, etc.) or =AVERAGE(Start Value:End Value). This will calculate the average of all the values or range of cells included in the parentheses.

6 0
3 years ago
You're making great progress on your assignment. You've defined the purpose of your message, identified both the primary and sec
Varvara68 [4.7K]

The most effective way to convey your marketing message is to use the channel and media most used by your potential audience.

To discover the most effective channels and means to reach your audience, market research, online traffic study and other strategies to identify the habits and customs of your target market can be carried out.

A marketing message must be written in a way that engages consumers, creates value and desire for your product or service.

Relationship marketing is a strategy used by companies to create greater proximity and identification of the public with an organization through messages that generate greater value than just advertising, such as the use of blogs, tips, humor elements and other ways to engage the consumer to relate to the company in the language and perspective of the media where the message was conveyed.

The message effectiveness monitoring program is also essential for analyzing the effect of advertising on consumers, through publication traffic, number of visits, hours, number of clicks on the page, etc.

These message tracking programs are effective so that the marketing team can analyze, review and improve their communication through the data and information obtained.

Learn more here:

brainly.com/question/3100288

7 0
3 years ago
Write 5 things that can be done to avoid computer vision syndrome
weeeeeb [17]
Get a comprehensive eye exam.
Use proper lighting.
Minimize glare.
Upgrade your display.
Adjust your computer display settings
Blink more often.
Exercise your eyes.
Take frequent breaks.
6 0
3 years ago
Read 2 more answers
___________ is a computer processor which incorporates the functions of a computer's central processing unit (CPU) on a single i
Yanka [14]

Answer:

Microprocessor

Explanation:

A microprocessor is a programmable chip that incorporates in itself the functions of a computer's central processing unit. It contains millions of small components such as transistors and resistors. In fact, the microprocessor is sometimes called the CPU itself as it contains an Arithmetic Logic Unit(ALU), a control unit and register array.

They work at a very high speed due to the components that they contain and are available at relatively low cost. They are portable, reliable and compared to vacuum tubes, they generate less heat.

<em>Hope this helps!</em>

6 0
3 years ago
Read 2 more answers
What is the name of the function below?<br><br> function go(){<br> alert("hello everybody");<br> }
labwork [276]

Answer:

It’s Java script I think and it makes something say hello everybody

Explanation:

6 0
3 years ago
Other questions:
  • This is an electronic method used to send and receive data–voice, text, images, and video.
    13·2 answers
  • Sarah is creating and formatting a newsletter for her school. Which page layout rules should she consider when doing this?
    13·2 answers
  • What part of a check is the LEAST important?
    14·2 answers
  • A browser is used for creating Web pages. true or false?
    5·2 answers
  • Green Field county stadium is planning to conduct a cricket match between two teams A and B. A large crowd is expected in the st
    6·1 answer
  • All 24-point fonts take up the same amount of space on a slide. True False
    7·2 answers
  • Describe how the presence or absence of balance can affect a visitor’s perceptions of a Web page.
    7·1 answer
  • Which of the following best describes the basic purpose of the internet?
    11·1 answer
  • Kyle returns to work the next day and he would like to continue working on the document from yesterday. What should Kyle do?
    7·1 answer
  • Python program oranges and apples 3.4.6 copy and paste would be nice
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!