We are trying to create a web application to teach units to students of 4-6'th grade, the question would be like
what is average velocity of the car that moved 60km in 3 hrs?
The answer would be 20 km/hr, one way is we can give single input so that student can enter 20 km/hr, another way is there will be 2 inputs, the student has to type 20 in one input and km/hr in another input?
Most of the students uses the web application in a phone, so Which way would be intuitive, or is there any other way to do this, I am new to UX, suggestions would be appreciated.
Think about the goal of your web application.
In this case the goal is to teach units to 4-6th grade students. Wouldn't it be better to specifically ask them to enter the unit in a separate field? It would draw more attention to what you're trying to teach your students.
Also, and correct me if I'm wrong, you can't check if the '20' is correct and the 'km/h' is correct if you put it in one text field. You need two text fields for that.
It's important to be consistent in your placement of labels and text fields, but also to put units where your users expect them to be. As for your example you could use USD instead of $. I believe USD is positioned after the value.
I think you have answered your own question. The way you have asked the question means the student only needs to enter a simple number, i.e. car moved 60km in 3 hours. So the student already knows the number will be km. You can use the same approach for currencies - just frame the question in such a way that it is really clear that the number to be entered is a currency and the student just enters a simple number.
I will suggest you to keep a single field for answer and mention the required unit/currency in question itself. For example:
what is average velocity of the car (in km/hr) that moved 60km in 3 hrs?
It will serve following purpose: