Advertisement
AalborgHTX

Klasse og objekter

May 30th, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. namespace WindowsFormsApplication154
  2. {
  3.     public partial class Form1 : Form
  4.     {
  5.         public Form1()
  6.         {
  7.             InitializeComponent();
  8.         }
  9.  
  10.         private void button1_Click(object sender, EventArgs e)
  11.         {
  12.             Bankkunde kunde1 = new Bankkunde();
  13.             kunde1.saldo = 200;
  14.             kunde1.saldo = kunde1.saldo + 100;
  15.             int tal = kunde1.volapyk();
  16.         }
  17.     }
  18. }
  19.  
  20.  
  21. using System;
  22. using System.Collections.Generic;
  23. using System.Linq;
  24. using System.Text;
  25. using System.Threading.Tasks;
  26.  
  27. namespace WindowsFormsApplication154
  28. {
  29.     class Bankkunde
  30.     {
  31.         public int cpr;
  32.         public int saldo;
  33.  
  34.         public int volapyk()
  35.         {
  36.             return cpr * saldo;
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement