forked from VolodymyrNyshta/Lv-703
-
Notifications
You must be signed in to change notification settings - Fork 0
/
homework1.cs
32 lines (29 loc) · 1.18 KB
/
homework1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
namespace Homework1
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter side of the square: ");
int a = int.Parse(Console.ReadLine());
int squareAria = a * a;
int squarePerimetr = a + a;
Console.WriteLine($"Square aria = {squareAria}");
Console.WriteLine($"Square perimetr = {squarePerimetr}");
Console.Write("\nWhat is you name: ");
string name = Console.ReadLine();
Console.WriteLine($"How old are you, {name}?");
int age = int.Parse(Console.ReadLine());
Console.WriteLine($"{name} is {age}.");
Console.Write("\nEnter radius of the circle:");
double radius = double.Parse(Console.ReadLine());
double length = 2 * Math.PI * radius;
double area = Math.PI * Math.Pow(radius, 2);
double volume = (4 / 3) * Math.PI * Math.Pow(radius, 3);
Console.WriteLine($"Length of circle = {length :F2}");
Console.WriteLine($"Area of circle = {area :F2}");
Console.WriteLine($"Volume of circle = {volume :F2}");
}
}
}