Answer the question
In order to leave comments, you need to log in
When I try to compile, I get an error - The input string had an invalid format, what's the problem?
class Program
{
static void Main(string[] args)
{
SportCar SC = new SportCar("green", 2000, 250, 7, true);
Console.WriteLine("SC.color ={ 0},SC.ves ={ 1},SC.power ={ 2},SC.transmission ={ 3},SC.complete_drive{ 4}", SC.color, SC.ves, SC.power, SC.transmission, SC.complete_drive);
Console.ReadLine();
}
}
class Car
{
public string color;
public int ves;
public int power;
public Car(string color, int ves, int power)
{
this.color = color;
this.ves = ves;
this.power = power;
}
}
class SportCar : Car
{
public short transmission;
public bool complete_drive;
public SportCar(string color,int ves, int power, short transmission,bool complete_drive)
:base(color,ves,power)
{
this.transmission = transmission;
this.complete_drive = complete_drive;
}
}
Answer the question
In order to leave comments, you need to log in
here (problem) with spaces:
remove spaces:
(where { 0}, { 1} ... need {0}, {1})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question