Aykon

Oef1p24

Mar 8th, 2023
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. //Business.cs
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace Oef1p24Hello
  10. {
  11.     class Business
  12.     {
  13.         private string naam;
  14.        
  15.        
  16.         public string maakHallo(string pnaam)
  17.         {
  18.             return "Hello " + pnaam;
  19.         }
  20.  
  21.         public string Naam
  22.         {
  23.             get { return naam; }
  24.             set { naam = value; }
  25.         }
  26.     }
  27. }
  28.  
  29.  
  30. //Program.cs
  31. using System;
  32. using System.Collections.Generic;
  33. using System.Linq;
  34. using System.Text;
  35. using System.Threading.Tasks;
  36.  
  37. namespace Oef1p24Hello
  38. {
  39.     class Program
  40.     {
  41.         static void Main(string[] args)
  42.         {
  43.             Business rekenen = new Business();
  44.            
  45.             Console.WriteLine("Wat is de naam?");
  46.             rekenen.Naam = Console.ReadLine();
  47.  
  48.             Console.ForegroundColor = ConsoleColor.Green;
  49.  
  50.             Console.WriteLine("Hallo, " + rekenen.Naam);
  51.  
  52.             Console.ReadLine();
  53.         }
  54.     }
  55. }
  56.  
Advertisement
Add Comment
Please, Sign In to add comment