Rozi. Diberdayakan oleh Blogger.

Sabtu, 07 Desember 2013

Praktikum ASP 3



Malam :)

langsung saja buka visual studionya klik new project>>C#>>klik console Aplication
masukkan script berikut :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VolumeBendaRuang
{
    class Program
    {
        static void Main(string[] args)
        {
        z:
            Console.WriteLine("\nProgram Volume");
            Console.Write("1. Volume Balok\n2. Volume Kubus\n3. Volume Kerucut\n4. Biodataku \n5. Exit From Dakan\n6");
            Console.Write("Masukan Pilihan : ");
            int a = Convert.ToInt16(Console.ReadLine());
            switch (a)
            {
                case 1:
                    Console.WriteLine("\nProgram Volume Balok");
                    Console.Write("Masukan Panjang Balok :");
                    float p = Convert.ToSingle(Console.ReadLine());
                    Console.Write("Masukan Lebar Balok :");
                    float l = Convert.ToSingle(Console.ReadLine());
                    Console.Write("Masukan Tinggi Balok :");
                    float t = Convert.ToSingle(Console.ReadLine());
                    float vb = p * l * t;
                    Console.Write("Volume Balok: {0}", vb);
                    Console.ReadLine();
                    goto z;
                case 2:
                    Console.WriteLine("\nProgram Volume Kubus");
                    Console.Write("Masukan Sisi Kubus :");
                    float s = Convert.ToSingle(Console.ReadLine());
                    float vk = s * s * s;
                    Console.Write("Volume Kubus: {0}", vk);
                    Console.ReadLine();
                    goto z;
                case 3:
                    Console.WriteLine("\nProgram Volume Kerucut");
                    float phi = 3.14f;
                    Console.Write("Masukan Jari-Jari Kerucut :");
                    float r = Convert.ToSingle(Console.ReadLine());
                    Console.Write("Masukan Tinggi Kerucut :");
                    float tk = Convert.ToSingle(Console.ReadLine());
                    float vkr = phi * tk * r;
                    Console.Write("Volume Kerucut: {0}", vkr);
                    Console.ReadLine();
                    goto z;
                case 4:
                    string nama, ttl, asal_smp, alamat, tinggi_dan_berat, cita_cita, agama, hobi;
                    Console.Write("Masukan Nama Anda\t\t\t: ");
                    nama = Console.ReadLine();
                    Console.Write("Masukan Tempat Tanggal Lahir Anda\t: ");
                    ttl = Console.ReadLine();
                    Console.Write("Masukan Asal SMP\t\t\t: ");
                    asal_smp = Console.ReadLine();
                    Console.Write("Masukan Alamat Anda\t\t\t: ");
                    alamat = Console.ReadLine();
                    Console.Write("Masukan Tinggi dan Berat Anda\t\t: ");
                    tinggi_dan_berat = Console.ReadLine();
                    Console.Write("Masukan Cita-cita Anda\t\t\t: ");
                    cita_cita = Console.ReadLine();
                    Console.Write("Masukan Agama Anda\t\t\t: ");
                    agama = Console.ReadLine();
                    Console.Write("Masukan Hobi-hobi Anda : ");
                    hobi = Console.ReadLine();
                    Console.WriteLine("Nama\t\t\t= {0} \nTempat Tanggal Lahir\t= {1} \nAsal SMP\t\t\t= {2} \nAlamat\t\t\t= {2} \nTinggi dan berat\t\t= {2} \nCita-Cita\t\t\t= {2} {2} \nAgama\t\t\t= {2} \nHobi-hobi Anda= {2} ",
                    nama, ttl, asal_smp, cita_cita, agama, hobi);
                    Console.ReadLine();
                    goto z;
            }
        }
    }
}

dan run program tersebut maka hassling akan seperti gambar dibawah :
Semoga Berhasil :)



Tidak ada komentar:

Posting Komentar

 

Blogroll

About

Masukan alamat Email kamu disini untuk mendapatkan artikel terbaru..!