121,553 views
42 votes
42 votes
Wtite a command to convert the points variable to any numerical data type (integer or float)

User Jasper Kuperus
by
2.9k points

2 Answers

9 votes
9 votes
String points = 200 for Java
User Ilyana
by
3.2k points
13 votes
13 votes

I am not sure what programming language that you are programming for, but I will assume Python/Java/C++.

Python:

points = "200"

points_Integer = int(points)

Java:

String points = "200"

int points_Integer = Integer.parseInt(points)

C++:

string points = "200";

int points_integer;

points_integer = (int) points;

I hope that this helps!

User MattClarke
by
3.2k points