Hello! How are you doing dear all?
I am trying to do some training in Csharp, typing a small console program to calculate vaules from seperated classes and methods, I have typed like these lines so far:
- using System;
- namespace spacesqm
- {
- public class EnterData
- {
- public int length;
- public int width;
- public int height;
- public int EnterNumbers ()
- {
- Console.WriteLine ("Welcome, Can you press any Key to proceed!");
- Console.ReadKey ();
-
- Console.WriteLine ("Type The Length in centimeter: ");
- length = Convert.ToInt32 (Console.ReadLine());
-
- Console.WriteLine ("Type The width in centimeter: ");
- width = Convert.ToInt32 (Console.ReadLine());
-
- Console.WriteLine ("Type The height in centimeter: ");
- height = Convert.ToInt32 (Console.ReadLine());
-
-
- Console.WriteLine ("Thank you a lot the information had been entered successfully!");
- Console.WriteLine ("Type any key to Calculate...");
- Console.ReadKey ();
- Console.Clear ();
- return (length, width, height) ;
- }
- }
- }
The problem is that, when I call the values from another class, the value return 0 eventhough...
Do you have any solution pls?
Thank you & Regards,
Ehssan Dannouf,