I'm new to Programming and trying to do an first Program.
I want to use a Method for the User input to change Variables from the Main function. But i get the Error: "Member 'float.Parse(string)' cannot be accessed with an instance reference"
Here's my Code
public class Program
{
public static void Main()
{ float salary = 0;
float rentalFee;
float powerCosts;
float gez;
bool gezMonth;
float insurence;
bool insurenceMonth;
userOutput("Geben sie einen Wert für ihr Gehalt ein");
salary = UserInput(Console.ReadLine());
Console.WriteLine(salary);
}
private static float UserInput(string usrInput)
{
float input= 0;
input.Parse(usrInput);
return input;
}
i googled the error but i don't really understand the answers :D is this cause its public ? Should i do the UserInputs in the Main function directly ?