volume of a sphere in a class

using System;
using System.Collections.Generic;
using System.Text;

namespace Tester
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("--------------------------- -");
Console.WriteLine("Program untuk menghitung = ");
Console.WriteLine("luas  Lingkaran ");
Console.WriteLine("volume Bola ");
Console.WriteLine("----------------------------");
Console.Write("\n");
String c;
{
Console.WriteLine(" Luas lingkaran");
}
Console.Write(" Saya memilih = ");
c = Console.ReadLine();
if (c == "a")
{
Console.WriteLine("  luas lingkaran");
Console.Write(" Masukkan jari2 = ");
r = double.Parse(Console.ReadLine());
L = 22 * r * r / 7;
Console.WriteLine(" Luas Lingkaran dengan phi (22/7) = " + L.ToString());
Console.WriteLine(" Atau");
L = 3.14 * r * r;
Console.WriteLine(" Luas Lingkaran dengan phi (3.14) = " + L.ToString());
}
else if (c == "b")
{
Console.WriteLine(" menghitung volume bola?");

Console.WriteLine("  Volume");
}

else if (c=="volume")
{
Console.WriteLine("  volume bola");
Console.Write(" jari2 Bola = ");
r = double.Parse(Console.ReadLine());
V = (4 * r * r * r * 22) / (3 * 7);
Console.WriteLine(" Volume Bola dengan phi (22/7) = " + V.ToString());
Console.WriteLine(" Atau");
V = 4 * r * r * r * 3.14 / 3;
Console.WriteLine(" Volume Bola dengan phi (3.14) = " + V.ToString());
}
else
{
Console.WriteLine(" Pilih menghitung luas lingkaran dan volume bola?");
}
Console.Write("\n");
Console.WriteLine(" Terima kasih");
Console.ReadLine();
}
}
}

Leave reply

Back to Top