HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


150. 50375 - Area of Circles

Guest
• Review clarifications (1)

Volume problems

• 120. 50684 - Sum of prime numbers...
• 125. 50578 - Mersenne prime
• 130. 50652 - Prime Factorization
• 132. 50474 - Sum of Two Primes
• 135. 50572 - Palindromic Numbers
• 140. 50393 - Palindromic Numbers
• 145. 50586 - Prime Palindromes
• 148. 50412 - K numbers
• 150. 50375 - Area of Circles
• 160. 50388 - Number of Armstrong ...
• 160. 50571 - Armstrong Numbers - 2
• 165. 50577 - Perfect Numbers and ...
• 190. 50533 - Contacts List
• 200. 50454 - What day is it?
• 210. 50369 - Base Conversion
• 250. 50385 - The 3n + 1 problem
• 260. 50493 - n-digit kth Prime Number

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Area of Circles

Note: This question has been designed for C & C++. It will not work for other programming languages.
Question: Assume that you are given the following functions and constant PI in the header file areaofCircle.h :

  • const double PI=3.14159;
  • double Area(int radius); // calculates the area of a circle with the given radius
  • bool Continue(); // asks to the user if he wants to continue or not. If the user
  •           // says 'y' it returns true, it returns false otherwise
  • int getRadius(); // this function gets radius from keyboard
  • void showResult(double area); // shows the result on screen

Using the functions above in your program, calculate and show the area as far as the function Continue(); produces true, (the user enters 'y').
Note: For C and C++, you can include the functions using the following statement.
  #include "utils/areaofCircle.h"

Input specification
You will get the input through the function getRadius();

Output specification
You will show the result through the function showResult(double area);

Для отправки решений необходимо выполнить вход.

www.contester.ru