There is no argument given that corresponds to the required formal parameter - What does this mean?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to call the method but for some reason it wont work
can someone tell me how to build a better method.
namespace ObjectsLifeTime
{
class Program
{
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
}
class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public static string Stats(Car car)
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = car.Make;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
}
}
c#
add a comment |
I am trying to call the method but for some reason it wont work
can someone tell me how to build a better method.
namespace ObjectsLifeTime
{
class Program
{
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
}
class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public static string Stats(Car car)
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = car.Make;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
}
}
c#
1
What if you explained more what you are doing and what exactly is failing, instead of repeating your text to meet up the character count requirement?
– Patrick Hofman
Jan 3 at 12:18
Console.WriteLine(myCar.Stats());
should likely beConsole.WriteLine(Car.Stats(myCar));
– mjwills
Jan 3 at 12:26
Alternatively, if you don't want to make that change, instead changepublic static string Stats(Car car) {
topublic string Stats() { var car = this;
.
– mjwills
Jan 3 at 12:27
add a comment |
I am trying to call the method but for some reason it wont work
can someone tell me how to build a better method.
namespace ObjectsLifeTime
{
class Program
{
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
}
class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public static string Stats(Car car)
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = car.Make;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
}
}
c#
I am trying to call the method but for some reason it wont work
can someone tell me how to build a better method.
namespace ObjectsLifeTime
{
class Program
{
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
}
class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public static string Stats(Car car)
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = car.Make;
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = car.Make;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
}
}
c#
c#
edited Jan 3 at 12:18


Mat
167k29323349
167k29323349
asked Jan 3 at 12:17


Ibraheem AyubIbraheem Ayub
81
81
1
What if you explained more what you are doing and what exactly is failing, instead of repeating your text to meet up the character count requirement?
– Patrick Hofman
Jan 3 at 12:18
Console.WriteLine(myCar.Stats());
should likely beConsole.WriteLine(Car.Stats(myCar));
– mjwills
Jan 3 at 12:26
Alternatively, if you don't want to make that change, instead changepublic static string Stats(Car car) {
topublic string Stats() { var car = this;
.
– mjwills
Jan 3 at 12:27
add a comment |
1
What if you explained more what you are doing and what exactly is failing, instead of repeating your text to meet up the character count requirement?
– Patrick Hofman
Jan 3 at 12:18
Console.WriteLine(myCar.Stats());
should likely beConsole.WriteLine(Car.Stats(myCar));
– mjwills
Jan 3 at 12:26
Alternatively, if you don't want to make that change, instead changepublic static string Stats(Car car) {
topublic string Stats() { var car = this;
.
– mjwills
Jan 3 at 12:27
1
1
What if you explained more what you are doing and what exactly is failing, instead of repeating your text to meet up the character count requirement?
– Patrick Hofman
Jan 3 at 12:18
What if you explained more what you are doing and what exactly is failing, instead of repeating your text to meet up the character count requirement?
– Patrick Hofman
Jan 3 at 12:18
Console.WriteLine(myCar.Stats());
should likely be Console.WriteLine(Car.Stats(myCar));
– mjwills
Jan 3 at 12:26
Console.WriteLine(myCar.Stats());
should likely be Console.WriteLine(Car.Stats(myCar));
– mjwills
Jan 3 at 12:26
Alternatively, if you don't want to make that change, instead change
public static string Stats(Car car) {
to public string Stats() { var car = this;
.– mjwills
Jan 3 at 12:27
Alternatively, if you don't want to make that change, instead change
public static string Stats(Car car) {
to public string Stats() { var car = this;
.– mjwills
Jan 3 at 12:27
add a comment |
3 Answers
3
active
oldest
votes
Following code should fix your issue
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
Console.ReadKey();
}
public class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public string Stats()
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = Model;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = Year.ToString();
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = Colour;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
add a comment |
Your Stats function is static.
If you did it intentionally then you can access it via the class name Car.Stats()
If you want to access it from each of the instances of the class Car then you need to make a regular function (remove the static...)
Thanks That helped but what does static actually do? could you please put in an example - everywhere I've looked is too vague or over-complicated
– Ibraheem Ayub
Jan 4 at 13:17
docs.microsoft.com/en-us/dotnet/csharp/language-reference/…
– Idan Marko
Jan 6 at 11:09
add a comment |
In object oriented programming class is a template of something... like car.
Car is the template but volvo for example is an instance of car.
volvo was made out of the template of car but it is a single instance of it.
all of the properties and function defined in the class car can be access threw volvo instance.
when talking about static what we really want to say is that in some cases we would like to have the ability to use a function or a property with no relation to instance of the class.. let's suppose we have the class car.
in the class car we create a static member named gasPrice
public class Car
{
public static double gasPrice =5;
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
}
Now this property is shared between all the instances of car... volvo honda what ever... you cannot edit it only for one of them.
The value of gasPrice set by the class level... now it צakes sense that we cant access it from one of the instances...
We can access it only from the class name because it is related to the class!
link for static explained
Cheers!
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54022141%2fthere-is-no-argument-given-that-corresponds-to-the-required-formal-parameter-w%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Following code should fix your issue
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
Console.ReadKey();
}
public class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public string Stats()
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = Model;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = Year.ToString();
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = Colour;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
add a comment |
Following code should fix your issue
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
Console.ReadKey();
}
public class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public string Stats()
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = Model;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = Year.ToString();
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = Colour;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
add a comment |
Following code should fix your issue
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
Console.ReadKey();
}
public class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public string Stats()
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = Model;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = Year.ToString();
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = Colour;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
Following code should fix your issue
static void Main(string args)
{
Car myCar = new Car();
myCar.Make = "Ford";
myCar.Model = "Something";
myCar.Year = 2010;
myCar.Colour = "Blue";
Console.WriteLine(myCar.Stats());
Console.ReadKey();
}
public class Car
{
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
public string Stats()
{
string restart = "false";
do
{
restart = "false";
Console.WriteLine("Press a to get the Make of the car");
Console.WriteLine("Press s to get the Model of the car");
Console.WriteLine("Press d to get the Year of the car");
Console.WriteLine("Press f to get the Colour of the car");
}
while (restart == "true");
string UserInput = Console.ReadLine();
if (UserInput == "a")
{
string UserOutput = Make;
return UserOutput;
}
if (UserInput == "s")
{
string UserOutput = Model;
return UserOutput;
}
if (UserInput == "d")
{
string UserOutput = Year.ToString();
return UserOutput;
}
if (UserInput == "f")
{
string UserOutput = Colour;
return UserOutput;
}
else
{
restart = "true";
string UserOutput = "I did not understand that";
return UserOutput;
}
}
}
answered Jan 3 at 12:29
Prasanth V JPrasanth V J
795928
795928
add a comment |
add a comment |
Your Stats function is static.
If you did it intentionally then you can access it via the class name Car.Stats()
If you want to access it from each of the instances of the class Car then you need to make a regular function (remove the static...)
Thanks That helped but what does static actually do? could you please put in an example - everywhere I've looked is too vague or over-complicated
– Ibraheem Ayub
Jan 4 at 13:17
docs.microsoft.com/en-us/dotnet/csharp/language-reference/…
– Idan Marko
Jan 6 at 11:09
add a comment |
Your Stats function is static.
If you did it intentionally then you can access it via the class name Car.Stats()
If you want to access it from each of the instances of the class Car then you need to make a regular function (remove the static...)
Thanks That helped but what does static actually do? could you please put in an example - everywhere I've looked is too vague or over-complicated
– Ibraheem Ayub
Jan 4 at 13:17
docs.microsoft.com/en-us/dotnet/csharp/language-reference/…
– Idan Marko
Jan 6 at 11:09
add a comment |
Your Stats function is static.
If you did it intentionally then you can access it via the class name Car.Stats()
If you want to access it from each of the instances of the class Car then you need to make a regular function (remove the static...)
Your Stats function is static.
If you did it intentionally then you can access it via the class name Car.Stats()
If you want to access it from each of the instances of the class Car then you need to make a regular function (remove the static...)
answered Jan 3 at 12:57
Idan MarkoIdan Marko
92
92
Thanks That helped but what does static actually do? could you please put in an example - everywhere I've looked is too vague or over-complicated
– Ibraheem Ayub
Jan 4 at 13:17
docs.microsoft.com/en-us/dotnet/csharp/language-reference/…
– Idan Marko
Jan 6 at 11:09
add a comment |
Thanks That helped but what does static actually do? could you please put in an example - everywhere I've looked is too vague or over-complicated
– Ibraheem Ayub
Jan 4 at 13:17
docs.microsoft.com/en-us/dotnet/csharp/language-reference/…
– Idan Marko
Jan 6 at 11:09
Thanks That helped but what does static actually do? could you please put in an example - everywhere I've looked is too vague or over-complicated
– Ibraheem Ayub
Jan 4 at 13:17
Thanks That helped but what does static actually do? could you please put in an example - everywhere I've looked is too vague or over-complicated
– Ibraheem Ayub
Jan 4 at 13:17
docs.microsoft.com/en-us/dotnet/csharp/language-reference/…
– Idan Marko
Jan 6 at 11:09
docs.microsoft.com/en-us/dotnet/csharp/language-reference/…
– Idan Marko
Jan 6 at 11:09
add a comment |
In object oriented programming class is a template of something... like car.
Car is the template but volvo for example is an instance of car.
volvo was made out of the template of car but it is a single instance of it.
all of the properties and function defined in the class car can be access threw volvo instance.
when talking about static what we really want to say is that in some cases we would like to have the ability to use a function or a property with no relation to instance of the class.. let's suppose we have the class car.
in the class car we create a static member named gasPrice
public class Car
{
public static double gasPrice =5;
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
}
Now this property is shared between all the instances of car... volvo honda what ever... you cannot edit it only for one of them.
The value of gasPrice set by the class level... now it צakes sense that we cant access it from one of the instances...
We can access it only from the class name because it is related to the class!
link for static explained
Cheers!
add a comment |
In object oriented programming class is a template of something... like car.
Car is the template but volvo for example is an instance of car.
volvo was made out of the template of car but it is a single instance of it.
all of the properties and function defined in the class car can be access threw volvo instance.
when talking about static what we really want to say is that in some cases we would like to have the ability to use a function or a property with no relation to instance of the class.. let's suppose we have the class car.
in the class car we create a static member named gasPrice
public class Car
{
public static double gasPrice =5;
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
}
Now this property is shared between all the instances of car... volvo honda what ever... you cannot edit it only for one of them.
The value of gasPrice set by the class level... now it צakes sense that we cant access it from one of the instances...
We can access it only from the class name because it is related to the class!
link for static explained
Cheers!
add a comment |
In object oriented programming class is a template of something... like car.
Car is the template but volvo for example is an instance of car.
volvo was made out of the template of car but it is a single instance of it.
all of the properties and function defined in the class car can be access threw volvo instance.
when talking about static what we really want to say is that in some cases we would like to have the ability to use a function or a property with no relation to instance of the class.. let's suppose we have the class car.
in the class car we create a static member named gasPrice
public class Car
{
public static double gasPrice =5;
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
}
Now this property is shared between all the instances of car... volvo honda what ever... you cannot edit it only for one of them.
The value of gasPrice set by the class level... now it צakes sense that we cant access it from one of the instances...
We can access it only from the class name because it is related to the class!
link for static explained
Cheers!
In object oriented programming class is a template of something... like car.
Car is the template but volvo for example is an instance of car.
volvo was made out of the template of car but it is a single instance of it.
all of the properties and function defined in the class car can be access threw volvo instance.
when talking about static what we really want to say is that in some cases we would like to have the ability to use a function or a property with no relation to instance of the class.. let's suppose we have the class car.
in the class car we create a static member named gasPrice
public class Car
{
public static double gasPrice =5;
public string Make { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Colour { get; set; }
}
Now this property is shared between all the instances of car... volvo honda what ever... you cannot edit it only for one of them.
The value of gasPrice set by the class level... now it צakes sense that we cant access it from one of the instances...
We can access it only from the class name because it is related to the class!
link for static explained
Cheers!
answered Jan 5 at 16:18
Idan MarkoIdan Marko
92
92
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54022141%2fthere-is-no-argument-given-that-corresponds-to-the-required-formal-parameter-w%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What if you explained more what you are doing and what exactly is failing, instead of repeating your text to meet up the character count requirement?
– Patrick Hofman
Jan 3 at 12:18
Console.WriteLine(myCar.Stats());
should likely beConsole.WriteLine(Car.Stats(myCar));
– mjwills
Jan 3 at 12:26
Alternatively, if you don't want to make that change, instead change
public static string Stats(Car car) {
topublic string Stats() { var car = this;
.– mjwills
Jan 3 at 12:27