Solution
Let’s look at how we should go about this.
The first thing is deciding the variable name, which you were told to keep as newType.
As type casting is from Float to Double when defining newType specify the data type as Double.
The last step is simply assigning newType the value of oldType.
val newType: Double = oldType
You can find the complete solution below:
You were required to write the code on line 2.