Advertisement
viciousojs

Untitled

Jun 22nd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.23 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace enumerasi
  8. {
  9.     class Program
  10.     { enum namatas
  11.         {
  12.             gucci, channel, buccery
  13.         }
  14.       enum pillevel
  15.         {
  16.             gold,silver,platinum
  17.  
  18.         }
  19.         struct Tas
  20.         {
  21.             public string nama;
  22.             public string piltas;
  23.             public string level;
  24.             public string pillevel;
  25.             public int harga;
  26.             public int jumlah;
  27.             public int total;
  28.          
  29.          
  30.            
  31.         }
  32.         static void Main(string[] args)
  33.         {
  34.          
  35.             Tas ts = new Tas();
  36.             ts.nama = "Gucci";
  37.             ts.nama = "Channel";
  38.             ts.nama = "Buccery";
  39.             Console.WriteLine("1.gucci");
  40.             Console.WriteLine("2.channel");
  41.             Console.WriteLine("3.buccery");
  42.             Console.Write("masukkan pilihan tas  [1-3] : ");
  43.             ts.piltas =Console.ReadLine();
  44.             Console.WriteLine("1.gold");
  45.             Console.WriteLine("2.silver");
  46.             Console.WriteLine("3.platinum");
  47.             Console.Write("masukkan level [1-3] : ");
  48.             ts.pillevel = Console.ReadLine();
  49.             Console.Write("masukkan jumlah tas : ");
  50.             ts.jumlah = int.Parse(Console.ReadLine());
  51.             ts.total = ts.jumlah * ts.harga;
  52.             if (ts.pillevel == "gold")
  53.             {
  54.                 Console.WriteLine("1000000");
  55.              }
  56.             else if(ts.pillevel == "silver")
  57.             {
  58.                 Console.WriteLine("700000");
  59.             }
  60.             else if (ts.pillevel == "platinum")
  61.             {
  62.                 Console.WriteLine("400000");
  63.             }
  64.             else
  65.             {
  66.                 ts.pillevel = "Tidak Valid.";
  67.             }
  68.             Console.Clear();
  69.             Console.WriteLine("Tas : " + ts.nama);
  70.             Console.WriteLine("Harga : " + ts.harga);
  71.             Console.WriteLine("Level : " + ts.level);
  72.             Console.WriteLine("Jumlah : " + ts.jumlah);
  73.             Console.WriteLine("Total : " + ts.total);
  74.             Console.ReadKey();
  75.         }
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement