Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Business.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Oef2p24Omkeren
- {
- class Business
- {
- private string naam;
- public string keerOm(string pinvoer)
- {
- string resultaat="";
- for(int teller = pinvoer.Length-1; teller >= 0; teller--)
- {
- resultaat += pinvoer[teller];
- }
- return resultaat;
- }
- public string Naam
- {
- get { return naam; }
- set { naam = value; }
- }
- }
- }
- //Program.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Oef2p24Omkeren
- {
- class Program
- {
- static void Main(string[] args)
- {
- Business rekenen = new Business();
- Console.WriteLine("Wat is de naam?");
- rekenen.Naam = Console.ReadLine();
- Console.ForegroundColor = ConsoleColor.Green;
- Console.WriteLine(rekenen.keerOm(rekenen.Naam));
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment