Single File Programming Question
Problem Statement
Stiles is teaching about the concept of circumference through Hierarchical Inheritance.
He has created a base class called Circle that contains radius as an attribute. From this base class, he has derived two classes: Class1 and Class2. Each of these derived classes has a method to calculate the circumference of a circle.
Help him write the program and display the calculated circumferences using two classes.
Formulas
Circumference using class 1 = 2 _ 3.14159 _ radius Circumference using class 2 = 23.14 * radius
Refer to the below class diagram:
Input format :
The input consists of a double value, representing the radius of the circle.
Output format :
The first line of output prints "Class 1: X" where X is a double value, rounded off to two decimal places.
The second line prints "Class 2: Y" where Y is a double value, rounded off to two decimal places.
Refer to the sample outputs for formatting specifications.
Code constraints :
0.01 ≤ radius ≤ 100.00
Sample test cases :
Input 1 :
5.15
Output 1 :
Class 1: 32.36 Class 2: 119.17
Input 2 :
10.5
Output 2 :
Class 1: 65.97 Class 2: 242.97
Input 3 :
3.14159
Output 3 :
Class 1: 19.74 Class 2: 72.70