How to divide a character with a string in Ada
I'm trying to figure out how to divide a character with a string and get a float as the quota. I've done the following in my code:
Procedure extwo is
function "-"(Strang: in String;
Char: in Character) return Float is
F: Float := Float'Value(Strang);
begin
return Float(Character'Pos(Char)-48) - Float'Value(Strang);
end "-";
Differensen: Float;
Char: Character;
Strang: String(1.
Begin
Put("Mata in ett tecken: ");
Get(Char);
Put("Mata in en strΓ€ng med exakt 3 tecken: ");
Get(Strang);
Differensen:= Char-Strang;
Put("Du matade in tecknet: ");
Put(Char);
Put(" och strΓ€ngen: ");
Put(Strang);
Put(" och differensen blev ");
Put(Differensen, Fore=> 0);
end extwo;
With this I get the error messages: " invalid operand types for operator "-" ", " left operand has type "Standard.Character" " and " right operand has subtype of "Standard.String" defined at line 59 " all on line 95:22 which is the line where it says "Differensen:= Char-Strang;"