Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Main
- namespace BikeProject
- {
- public class Program
- {
- static void Main(string[] args)
- {
- Bike bik4e1 = new Bike("Drag", "Al", 21);
- Console.WriteLine("bik4e1 before:" + bik4e1.getBrand());
- bik4e1.relaceBrand("Drag1");
- Console.WriteLine("bik4e1 after:" + bik4e1.getBrand());
- Bike bik4e2 = new Bike("BMX", "Plastic", 3);
- Console.WriteLine("bik4e2 before:" + bik4e2.getBrand());
- bik4e2.relaceBrand("BMX1");
- Console.WriteLine("bik4e2 after:" + bik4e2.getBrand());
- }
- }
- }
- //Class Bike
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace BikeProject
- {
- public class Bike
- {
- private string Brand;
- private string Material;
- private int Speeds;
- public Bike(string brandP, string materialP, int speedsP)
- {
- this.Brand = brandP;
- this.Material = materialP;
- this.Speeds = speedsP;
- }
- public string getBrand()
- {
- return this.Brand;
- }
- public void relaceBrand(string newBrand)
- {
- this.Brand = newBrand;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement