Question

do a unit test for area circle c++

do a unit test for area circle c++

Homework Answers

Answer #1

I hope that you are asking an programme to find out the area of circle in C++ so here is the solution for it.

#include <iostream>
#define PI 3.14159
using namespace std;

int main()
{
//Define radius and area
float radius, area;
//Get the user input for the radius   
cout<<" Input the radius";
cin>>radius;
//Computer the area
area = PI*(radius*radius);
cout<<" The area of the circle is : "<< area << endl;
cout << endl;
return 0;
}

Kindly vote up if found useful

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
In C programming, Thank you Write a program to compute the area of a circle. You...
In C programming, Thank you Write a program to compute the area of a circle. You have to write a complete “C” program that compiles and runs in Codeblocks. Program requirements: 1. Declare the variables needed: radius (r) and area (yourLastName). 2. Calculate and print the area of each circle. 3. The program MUST prompt the user for a new radius (r) over and over until the user types -1. 5. Use the type double for all decimal numbers. 6....
# given a radius, find the area of a circle def get_area_circle(r):        """        ...
# given a radius, find the area of a circle def get_area_circle(r):        """         what it takes             radius of a circle (any positive real number)         what it does:             computes the area of a circle             given a radius, find the area of a circle             area = pi*r2 (pi times r squared)         what it returns             area of a circle. Any positive real number (float)     """         # your code goes in...
Create a flowgorithm program to calculate the Area of Circle first then do the Circumference of...
Create a flowgorithm program to calculate the Area of Circle first then do the Circumference of Circle. The user will have the ability to convert Area OR the Circumference. That means we need to add a decision structure to the program. Furthermore, they need to be able to do it as many times as they want. That means we need to add a main loop structure to the program. The user will also have the choice of whether to run...
Find the exact area of the region inside the circle r=2cos(theta) but outside the circle r=1
Find the exact area of the region inside the circle r=2cos(theta) but outside the circle r=1
Consider the unit circe C (the circle with center the origin in the plane and radius...
Consider the unit circe C (the circle with center the origin in the plane and radius 1). Let S = {α : 2α < (the circumference of C)} . Show that S is bounded above. Let p be the least upper bound of S. Say explicitly what the number p is. This exercise works in the real number system, but not in the rational number system. Why?
Find the area of the largest trapezoid that can be inscribed in a circle of radius...
Find the area of the largest trapezoid that can be inscribed in a circle of radius 2 and whose base in as diameter of the circle.
Two vertices of an equilateral triangle lie on a diameter of a circle whose area is...
Two vertices of an equilateral triangle lie on a diameter of a circle whose area is 36p cm2, and the third vertex lies on the circle. What is the largest possible area of the triangle?
If a circle C with radius 1 rolls along the outside of the circle x2 +...
If a circle C with radius 1 rolls along the outside of the circle x2 + y2 = 49, a fixed point P on C traces out a curve called an epicycloid, with parametric equations x = 8 cos(t) − cos(8t), y = 8 sin(t) − sin(8t). Use one of the formulas below to find the area it encloses. A = C x dy = −C  y dx = 1/2 C x dy − y dx
The circumference of a unit circle is 2π. The absolute value of -3π/2 is: ? of...
The circumference of a unit circle is 2π. The absolute value of -3π/2 is: ? of the total circumference of the unit circle .
1. a) Find the area of the lower half of the circle x^2 + y^2 =...
1. a) Find the area of the lower half of the circle x^2 + y^2 = 9. Do this by setting it up as an integral and solving the integral. (Should your answer be positive or negative? Please show your work) b) Find the area of a square of side length L by setting it up as an integral.