Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace enumerasi
- {
- class Program
- { enum namatas
- {
- gucci, channel, buccery
- }
- enum pillevel
- {
- gold,silver,platinum
- }
- struct Tas
- {
- public string nama;
- public string piltas;
- public string level;
- public string pillevel;
- public int harga;
- public int jumlah;
- public int total;
- }
- static void Main(string[] args)
- {
- Tas ts = new Tas();
- ts.nama = "Gucci";
- ts.nama = "Channel";
- ts.nama = "Buccery";
- Console.WriteLine("1.gucci");
- Console.WriteLine("2.channel");
- Console.WriteLine("3.buccery");
- Console.Write("masukkan pilihan tas [1-3] : ");
- ts.piltas =Console.ReadLine();
- Console.WriteLine("1.gold");
- Console.WriteLine("2.silver");
- Console.WriteLine("3.platinum");
- Console.Write("masukkan level [1-3] : ");
- ts.pillevel = Console.ReadLine();
- Console.Write("masukkan jumlah tas : ");
- ts.jumlah = int.Parse(Console.ReadLine());
- ts.total = ts.jumlah * ts.harga;
- if (ts.pillevel == "gold")
- {
- Console.WriteLine("1000000");
- }
- else if(ts.pillevel == "silver")
- {
- Console.WriteLine("700000");
- }
- else if (ts.pillevel == "platinum")
- {
- Console.WriteLine("400000");
- }
- else
- {
- ts.pillevel = "Tidak Valid.";
- }
- Console.Clear();
- Console.WriteLine("Tas : " + ts.nama);
- Console.WriteLine("Harga : " + ts.harga);
- Console.WriteLine("Level : " + ts.level);
- Console.WriteLine("Jumlah : " + ts.jumlah);
- Console.WriteLine("Total : " + ts.total);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement