Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Text;
- using static System.Console;
- namespace Konto
- {
- internal class Program
- {
- private static void Main(string[] args)
- {
- Konto ktn = new Konto()
- {
- Kontonummer = 1234567890,
- Kontoinhaber = "Max Mustermann",
- Saldo = 0,
- Kreditlimit = 100
- };
- Clear();
- OutputEncoding = Encoding.UTF8;
- WriteLine(ktn);
- ReadLine();
- }
- }
- public class Konto
- {
- public long Kontonummer { get; set; }
- public string Kontoinhaber { get; set; }
- public decimal Saldo { get; set; }
- public decimal Kreditlimit { get; set; }
- protected virtual string Ausgabe()
- {
- return $@"
- Kontonummer: {Kontonummer}
- Kontoinhaber: {Kontoinhaber}
- Saldo: {Saldo:C}
- Kreditlimit: {Kreditlimit:C}
- ";
- }
- public override string ToString()
- {
- return this.Ausgabe();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement