AalborgHTX

Bank2

Feb 27th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace bank2
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.         int[] Saldo = new int[10];
  20.  
  21.         private void btnHævIndsæt_Click(object sender, EventArgs e)
  22.         {
  23.             int kontonr = int.Parse(txtKonto1.Text);
  24.             int beløb = int.Parse(txtBeløb.Text);
  25.  
  26.             Saldo[kontonr] = Saldo[kontonr] + beløb;
  27.         }
  28.  
  29.         private void btnSaldo_Click(object sender, EventArgs e)
  30.         {
  31.             int kontonr = int.Parse(txtKonto2.Text);
  32.  
  33.             lblSaldo.Text = Saldo[kontonr].ToString();
  34.  
  35.  
  36.         }
  37.     }
  38. }
Add Comment
Please, Sign In to add comment