Using Using Using Using Namespace

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

/*

* Created by SharpDevelop.
* User: FUJITSU
* Date: 08/12/2018
* Time: 17:42
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace coba
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
int jmlkwh,biayaadm,harga,biayakwh,pajak,total;
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
lbbiayapajak.Text = "";
lbtotal.Text = "";
lbbiayakwh.Text = "";
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, EventArgs e)
{
jmlkwh = Int16.Parse(kwh.Text);
string jp = jenis.Text;
//Biaya Administrasi
if (jp.Trim() == "Reguler"){
biayaadm = 20000;
}else{
biayaadm = 35000;
}
//Biaya KwH
if (jp.Trim() =="Reguler"){
if(jmlkwh < 99){
harga = 90;
}else{
harga = 100;
}
}else{
if(jmlkwh < 99){
harga = 120;
}else{
harga = 150;
}
}
biayakwh = jmlkwh * harga;
pajak = (10 * biayakwh)/100;
total = biayakwh + pajak + biayaadm;
lbbiayakwh.Text = biayakwh.ToString();
lbbiayapajak.Text = pajak.ToString();
lbtotal.Text = total.ToString();
}
void BtndelClick(object sender, EventArgs e)
{
jenis.Text = "-Pilih-";
kwh.Text = "";
lbbiayapajak.Text = "";
lbtotal.Text = "";
lbbiayakwh.Text = "";
}
}
}

You might also like