ms_learn_csharp/028_method_parameters/parameter_scope/Program.cs
2024-08-10 23:44:42 -04:00

36 lines
921 B
C#

string[] students = {"Jenna", "Ayesha", "Carlos", "Viktor"};
display_students(students);
display_students(new string[] {"Robert","Vanya"});
void display_students(string[] students) {
foreach (string student in students) {
Console.Write($"{student}, ");
}
Console.WriteLine();
}
Console.WriteLine();
void print_circle_area(int radius) {
double area = Math.PI * (radius * radius);
Console.WriteLine($"Area = {area:F2}");
}
void print_circle_circumference(int radius) {
double circumference = 2 * Math.PI * radius;
Console.WriteLine($"Circumference = {circumference:F2}");
}
void print_circle_info(int radius){
Console.WriteLine($"Circle with radius {radius}");
print_circle_area(radius);
print_circle_circumference(radius);
Console.WriteLine();
}
//print_circle_area(12);
//print_circle_circumference(12);
print_circle_info(12);
print_circle_info(24);