hello everyone i have wrote a code but i have problem compiling it ( making it run )
it's running but there are no any text's that i'm typing in Writeline
here's the code!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication5 {
class Program {
static void Main(string[] args)
{
cars e1 = new cars();
books e2 = new books();
//cars parameters
e1.mark = "BMW";
e1.model = "M3";
e1.color = "Silver";
e1.price = 13000;
//book parameters
e2.author = "Fyodor Dostoyevsky";
e2.genre = "morality";
e2.name = "The Brothers Karamazov";
e2.price = 25;
Console.WriteLine(e1);
Console.ReadKey();
}
}
}
class cars {
public string mark;
public string model;
public string color;
public double price;
public void WriteInfo()
{
Console.WriteLine("cars: mark: {0} model: {1}. color: {2}. price: {3}", mark, model, color, price);
}
}
class books {
public string author;
public string genre;
public string name;
public double price;
public void WriteInfo()
{
Console.WriteLine("books: author: {0} genre: {1}. name: {2}. price: {3}", author, genre, name, price);
}
}