Monday, 5 January 2015

Contoh Script data transkrip nested array dengan c#

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string lagi;
            int data;
            string[] nama = new string[10];
            string[] npm = new string[10];
            string[] peminatan = new string[10];
            lagi:
            Console.WriteLine("Kode Pilihan Program Studi");
            Console.WriteLine("01 = Sistem Informasi");
            Console.WriteLine("02 = Teknik Informatika");
            Console.WriteLine("03 = Manajemen Informatika");
            Console.WriteLine("04 = Telkomunikasi");
            Console.WriteLine();

            Console.Write("Masukan Kode Prodi : ");
            string prodi = Console.ReadLine();

            switch (prodi)
            {
                case "01":
                    Console.WriteLine("sistem informasi");
                    Console.Write("Masukan banyak data : ");
                    data = int.Parse(Console.ReadLine());
                    Console.WriteLine();
                    for (int x = 0; x <= data - 1; x++)
                    {

                        Console.Write((x+1)+".nama       : ");
                        nama[x] = Console.ReadLine();

                        Console.Write("  NPM        : ");
                        npm[x] = Console.ReadLine();

                        Console.Write("  peminatan  : ");
                        peminatan[x] = Console.ReadLine();
                        Console.WriteLine();

                        Console.WriteLine("Kode Pilihan Mata Kuliah");
                        Console.WriteLine("01 =  Kalkulus");
                        Console.WriteLine("02 =  VB");
                        Console.WriteLine("03 =  C#");
                    lagimk:
                    atas:
                        Console.Write("Masukan Kode mata kuliah : ");
                        string kode = Console.ReadLine();                 
                        switch (kode)
                        {
                            case "01":
                                Console.WriteLine("Mata kuliah : kalkulus");
                                break;
                            case "02":
                                Console.WriteLine("Mata kuliah : VB");
                                break;
                            case "03":
                                Console.WriteLine("Mata kuliah : C#");
                                break;
                            default:
                                Console.WriteLine("Maaf! Kode Salah....!");
                                Console.Write("Coba Lagi? [y/t] : ");
                                string cobamk = Console.ReadLine();
                                Console.WriteLine();
                                switch (cobamk)
                                {
                                    case "y":
                                        goto lagimk;

                                        break;
                                    case "t":
                                        Console.WriteLine("Terima Kasih");
                                        Console.WriteLine();
                                        Console.WriteLine();
                                        Console.WriteLine();
                                        continue;
                                        break;
                                }
                                break;
                        }
                        Console.Write("Nilai UTS : ");
                        float uts = int.Parse(Console.ReadLine());
                        Console.Write("Nilai UAS : ");
                        float uas = int.Parse(Console.ReadLine());
                        Console.Write("Nilai Tugas : ");
                        float tugas = int.Parse(Console.ReadLine());
                        Console.Write("Nilai Kehadiran : ");
                        float hadir = int.Parse(Console.ReadLine());
                        float nilai;
                        nilai = (40 * uas / 100) + (30 * uts / 100) + (20 * tugas / 100) + (10 * hadir / 100);
                        Console.WriteLine("Nilai Total : " + nilai);

                        if (nilai >= 80)
                        {
                            Console.WriteLine("GRADE : A");
                            Console.WriteLine();
                        }
                        else if (nilai >= 60)
                        {
                            Console.WriteLine("GRADE : B");
                            Console.WriteLine();
                        }
                        else if (nilai >= 40)
                        {
                            Console.WriteLine("GRADE : C");
                            Console.WriteLine();
                        }
                        else if (nilai >= 20)
                        {
                            Console.WriteLine("GRADE : D");
                            Console.WriteLine();
                        }
                        else
                        {
                            Console.WriteLine("GRADE : E");
                            Console.WriteLine();

                        }
                        Console.Write("Masukan nilai lagi? [y/t] : ");
                        string input = Console.ReadLine();

                        switch (input)
                        {
                            case "y":
                                goto atas;
                                break;
                            case "t":
                                Console.WriteLine("Terima Kasih");
                                Console.WriteLine();
                                Console.WriteLine();
                                Console.WriteLine();
                                break;
                        }
                    }
                    Console.Write("Masukan Data Baru? [y/t] : ");
                    lagi = Console.ReadLine();

                    switch (lagi)
                    {
                        case "y":
                            Console.Clear();
                            goto lagi;
                            break;
                        case "t":
                            Console.WriteLine("Terima Kasih");
                            Console.WriteLine();
                            break;
                    }
                    break;

                case "02":
                    Console.WriteLine("teknik informatika");
                    Console.Write("Masukan banyak data : ");
                    data = int.Parse(Console.ReadLine());
                    Console.WriteLine();
                    for (int x = 0; x <= data - 1; x++)
                    {

                        Console.Write((x + 1) + ".nama       : ");
                        nama[x] = Console.ReadLine();

                        Console.Write("  NPM        : ");
                        npm[x] = Console.ReadLine();

                        Console.Write("  peminatan  : ");
                        peminatan[x] = Console.ReadLine();
                        Console.WriteLine();

                        Console.WriteLine("Kode Pilihan Mata Kuliah");
                        Console.WriteLine("01 =  Kalkulus");
                        Console.WriteLine("02 =  VB");
                        Console.WriteLine("03 =  C#");
                    lagimk:
                    atas:
                        Console.Write("Masukan Kode mata kuliah : ");
                        string kode = Console.ReadLine();
                        switch (kode)
                        {
                            case "01":
                                Console.WriteLine("Mata kuliah : kalkulus");
                                break;
                            case "02":
                                Console.WriteLine("Mata kuliah : VB");
                                break;
                            case "03":
                                Console.WriteLine("Mata kuliah : C#");
                                break;
                            default:
                                Console.WriteLine("Maaf! Kode Salah....!");
                                Console.Write("Coba Lagi? [y/t] : ");
                                string cobamk = Console.ReadLine();
                                Console.WriteLine();
                                switch (cobamk)
                                {
                                    case "y":
                                        goto lagimk;

                                        break;
                                    case "t":
                                        Console.WriteLine("Terima Kasih");
                                        Console.WriteLine();
                                        Console.WriteLine();
                                        Console.WriteLine();
                                        continue;
                                        break;
                                }
                                break;
                        }
                        Console.Write("Nilai UTS : ");
                        float uts = int.Parse(Console.ReadLine());
                        Console.Write("Nilai UAS : ");
                        float uas = int.Parse(Console.ReadLine());
                        Console.Write("Nilai Tugas : ");
                        float tugas = int.Parse(Console.ReadLine());
                        Console.Write("Nilai Kehadiran : ");
                        float hadir = int.Parse(Console.ReadLine());
                        float nilai;
                        nilai = (40 * uas / 100) + (30 * uts / 100) + (20 * tugas / 100) + (10 * hadir / 100);
                        Console.WriteLine("Nilai Total : " + nilai);

                        if (nilai >= 80)
                        {
                            Console.WriteLine("GRADE : A");
                            Console.WriteLine();
                        }
                        else if (nilai >= 60)
                        {
                            Console.WriteLine("GRADE : B");
                            Console.WriteLine();
                        }
                        else if (nilai >= 40)
                        {
                            Console.WriteLine("GRADE : C");
                            Console.WriteLine();
                        }
                       
else if (nilai >= 20)
                        {
                            Console.WriteLine("GRADE : D");
                            Console.WriteLine();
                        }
                        else
                        {
                            Console.WriteLine("GRADE : E");
                            Console.WriteLine();

                        }
                        Console.Write("Masukan nilai lagi? [y/t] : ");
                        string input = Console.ReadLine();

                        switch (input)
                        {
                            case "y":
                                goto atas;
                                break;
                            case "t":
                                Console.WriteLine("Terima Kasih");
                                Console.WriteLine();
                                Console.WriteLine();
                                Console.WriteLine();
                                break;
                        }
                    }
                    Console.Write("Masukan Data Baru? [y/t] : ");
                    lagi = Console.ReadLine();

                    switch (lagi)
                    {
                        case "y":
                            Console.Clear();
                            goto lagi;
                            break;
                        case "t":
                            Console.WriteLine("Terima Kasih");
                            Console.WriteLine();
                            break;
                    }
                    break;
                case "03":
                    Console.WriteLine("manajemen informatika");
                    Console.Write("Masukan banyak data : ");
                    data = int.Parse(Console.ReadLine());
                    Console.WriteLine();
                    for (int x = 0; x <= data - 1; x++)
                    {

                        Console.Write((x + 1) + ".nama       : ");
                        nama[x] = Console.ReadLine();

                        Console.Write("  NPM        : ");
                        npm[x] = Console.ReadLine();

                        Console.Write("  peminatan  : ");
                        peminatan[x] = Console.ReadLine();
                        Console.WriteLine();

                        Console.WriteLine("Kode Pilihan Mata Kuliah");
                        Console.WriteLine("01 =  Kalkulus");
                        Console.WriteLine("02 =  VB");
                        Console.WriteLine("03 =  C#");
                    lagimk:
                    atas:
                        Console.Write("Masukan Kode mata kuliah : ");
                        string kode = Console.ReadLine();
                        switch (kode)
                        {
                            case "01":
                                Console.WriteLine("Mata kuliah : kalkulus");
                                break;
                            case "02":
                                Console.WriteLine("Mata kuliah : VB");
                                break;
                            case "03":
                                Console.WriteLine("Mata kuliah : C#");
                                break;
                           

     default:
                                Console.WriteLine("Maaf! Kode Salah....!");
                                Console.Write("Coba Lagi? [y/t] : ");
                                string cobamk = Console.ReadLine();
                                Console.WriteLine();
                                switch (cobamk)
                                {
                                    case "y":
                                        goto lagimk;

                                        break;
                                    case "t":
                                        Console.WriteLine("Terima Kasih");
                                        Console.WriteLine();
                                        Console.WriteLine();
                                        Console.WriteLine();
                                        continue;
                                        break;
                                }
                                break;
                        }
                        Console.Write("Nilai UTS : ");
                        float uts = int.Parse(Console.ReadLine());
                        Console.Write("Nilai UAS : ");
                        float uas = int.Parse(Console.ReadLine());
                        Console.Write("Nilai Tugas : ");
                        float tugas = int.Parse(Console.ReadLine());
                        Console.Write("Nilai Kehadiran : ");
                        float hadir = int.Parse(Console.ReadLine());
                        float nilai;
                        nilai = (40 * uas / 100) + (30 * uts / 100) + (20 * tugas / 100) + (10 * hadir / 100);
                        Console.WriteLine("Nilai Total : " + nilai);

                        if (nilai >= 80)
                        {
                            Console.WriteLine("GRADE : A");
                            Console.WriteLine();
                        }
                        else if (nilai >= 60)
                        {
                            Console.WriteLine("GRADE : B");
                            Console.WriteLine();
                        }
                        else if (nilai >= 40)
                        {
                            Console.WriteLine("GRADE : C");
                            Console.WriteLine();
                        }
                        else if (nilai >= 20)
                        {
                            Console.WriteLine("GRADE : D");
                            Console.WriteLine();
                        }
                        else
                        {
                            Console.WriteLine("GRADE : E");
                            Console.WriteLine();

                        }
                        Console.Write("Masukan nilai lagi? [y/t] : ");
                        string input = Console.ReadLine();

                        switch (input)
                        {
                            case "y":
                                goto atas;
                                break;
                            case "t":
                                Console.WriteLine("Terima Kasih");
                                Console.WriteLine();
                                Console.WriteLine();
                                Console.WriteLine();
                                break;
                        }
                    }
                    Console.Write("Masukan Data Baru? [y/t] : ");
                    lagi = Console.ReadLine();
     switch (lagi)
                    {
                        case "y":
                            Console.Clear();
                            goto lagi;
                            break;
                        case "t":
                            Console.WriteLine("Terima Kasih");
                            Console.WriteLine();
                            break;
                    }
                    break;
                case "04":
                    Console.WriteLine("Telkomunikasi");
                    Console.Write("Masukan banyak data : ");
                    data = int.Parse(Console.ReadLine());
                    Console.WriteLine();
                    for (int x = 0; x <= data - 1; x++)
                    {

                        Console.Write((x + 1) + ".nama       : ");
                        nama[x] = Console.ReadLine();

                        Console.Write("  NPM        : ");
                        npm[x] = Console.ReadLine();

                        Console.Write("  peminatan  : ");
                        peminatan[x] = Console.ReadLine();
                        Console.WriteLine();

                        Console.WriteLine("Kode Pilihan Mata Kuliah");
                        Console.WriteLine("01 =  Kalkulus");
                        Console.WriteLine("02 =  VB");
                        Console.WriteLine("03 =  C#");
                    lagimk:
                    atas:
                        Console.Write("Masukan Kode mata kuliah : ");
                        string kode = Console.ReadLine();
                        switch (kode)
                        {
                            case "01":
                                Console.WriteLine("Mata kuliah : kalkulus");
                                break;
                            case "02":
                                Console.WriteLine("Mata kuliah : VB");
                                break;
                            case "03":
                                Console.WriteLine("Mata kuliah : C#");
                                break;
                            default:
                                Console.WriteLine("Maaf! Kode Salah....!");
                                Console.Write("Coba Lagi? [y/t] : ");
                                string cobamk = Console.ReadLine();
                                Console.WriteLine();
                                switch (cobamk)
                                {
                                    case "y":
                                        goto lagimk;

                                        break;
                                    case "t":
                                        Console.WriteLine("Terima Kasih");
                                        Console.WriteLine();
                                        Console.WriteLine();
                                        Console.WriteLine();
                                        continue;
                                        break;
                                }
                                break;
                        }
                        Console.Write("Nilai UTS : ");
                        float uts = int.Parse(Console.ReadLine());
                        Console.Write("Nilai UAS : ");
                        float uas = int.Parse(Console.ReadLine());
                        Console.Write("Nilai Tugas : ");
                        float tugas = int.Parse(Console.ReadLine());
                        Console.Write("Nilai Kehadiran : ");
                        float hadir = int.Parse(Console.ReadLine());
                        float nilai;
                        nilai = (40 * uas / 100) + (30 * uts / 100) + (20 * tugas / 100) + (10 * hadir / 100);
                        Console.WriteLine("Nilai Total : " + nilai);

                        


if (nilai >= 80)
                        {
                            Console.WriteLine("GRADE : A");
                            Console.WriteLine();
                        }
                        else if (nilai >= 60)
                        {
                            Console.WriteLine("GRADE : B");
                            Console.WriteLine();
                        }
                        else if (nilai >= 40)
                        {
                            Console.WriteLine("GRADE : C");
                            Console.WriteLine();
                        }
                        else if (nilai >= 20)
                        {
                            Console.WriteLine("GRADE : D");
                            Console.WriteLine();
                        }
                        else
                        {
                            Console.WriteLine("GRADE : E");
                            Console.WriteLine();

                        }
                        Console.Write("Masukan nilai lagi? [y/t] : ");
                        string input = Console.ReadLine();

                        switch (input)
                        {
                            case "y":
                                goto atas;
                                break;
                            case "t":
                                Console.WriteLine("Terima Kasih");
                                Console.WriteLine();
                                Console.WriteLine();
                                Console.WriteLine();
                                break;
                        }
                    }
                    Console.Write("Masukan Data Baru? [y/t] : ");
                    lagi = Console.ReadLine();

                    switch (lagi)
                    {
                        case "y":
                            Console.Clear();
                            goto lagi;
                            break;
                        case "t":
                            Console.WriteLine("Terima Kasih");
                            Console.WriteLine();
                            break;
                    }
                    break;

                default:
                    Console.WriteLine("Maaf! Kode Salah....!");
                    Console.Write("Coba Lagi? [y/t] : ");
                    string coba = Console.ReadLine();

                    switch (coba)
                    {
                        case "y":
                            Console.Clear();
                            goto lagi;

                            break;

                        case "t":
                            Console.WriteLine("Terima Kasih");
                            Console.WriteLine();
                            break;
                    }
                    break;
            }

        }

    }}

Download script Link1 / Link2


No comments:

Post a Comment