Hey i have a problem with my C# problem under the class cars. On each public declaration it is saying that it already contains a definition for 'idNumber', 'make', 'model', 'color', and 'cost'. I am using windows visual basic, here is my code.
using System;
using System.Collections.Generic;
using System.Text;
namespace CarsDemo.cs
{
class Cars
{
public int idNumber;
public string make;
public string model;
public string color;
public double cost;
public int idNumber
{
get
{
return idNumber;
}
set
{
idNumber = value;
}
}
public string make
{
get
{
return make;
}
set
{
make = value;
}
}
public string model
{
get
{
return model;
}
set
{
model = value;
}
}
public string color
{
get
{
return color;
}
set
{
color = value;
}
}
public double cost
{
get
{
return cost;
}
set
{
cost = value;
}
}
class fleet
{
public static void Main()
{
Cars first = new Cars();
Cars second = new Cars();
Cars third = new Cars();
Cars forth = new Cars();
Cars fith = new Cars();
first.idNumber = 1456;
first.make = "Bently";
first.model = "Continettal";
first.color = "Spruce";
first.cost = 175990.00;
second.idNumber = 1859;
second.make = "Ferrari";
second.model = "Enzo";
second.color = "Rosso Corsa";
second.cost = 680000.00;
third.idNumber = 1353;
third.make = "Lamborghini";
third.model = "Gallardo";
third.color = "Nero";
third.cost = 190000.00;
forth.idNumber = 1986;
forth.make = "Bugatti";
forth.model = "Veyron";
forth.color = "Indigo Blue and Vermilion";
forth.cost = 1600000.00;
fith.idNumber = 1990;
fith.make = "BMW";
fith.model = "Rolls-Royce Phantom";
fith.color = "Royal Blue";
fith.cost = 340000.00;
Display(first);
Display(second);
Display(third);
Display(forth);
Display(fith);
}
public static void Display(Cars stu)
{
Console.WriteLine("{0,5} {1,-10} {2,6}",
stu.IdNumber, stu.make, stu.model, stu.color,
stu.cost.ToDouble("F1"));
Console.ReadLine();
}
}
}
}
if you guys could help out with the code that would be aewsome.