Write a program that is able to compute circumferences of circles, given the rad
ID: 673371 • Letter: W
Question
Write a program that is able to compute circumferences of circles, given the radius of the circle.
Use three macros:
one that defines Pi
another one that computes the circumference, i.e. a macro that resembles a function
the number of RUNS, see below
Have the user input a radius, upon which the circumference is computed. Use a for-loop in order to go through a number of configurable RUNS, which will also be defined in a macro, i.e. called RUNS. For your submission, set RUNS to 5.
Steps to follow
Identify and document the input(s) and the output(s)
Describe the algorithm that solves the problem
Write the C program that solves the problem
What to submit
Submit two files through BBLearn:
One word document that contains your take on steps #s 1&2
A .c file that contains your C program developed in step #3
Explanation / Answer
class CircleDemo2 { public static void main(String args[]) { int radius = 3; double circumference= Math.PI * 2*radius; System.out.println( "The circumference of the circle is:"+circumference) ; } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.