Welcome to the Rocket Fuel Calculation mission! 🚀
Our astronauts are preparing to return to Earth, but we need to calculate the total amount of fuel available in the rocket's two fuel tanks.
In this lesson, you'll write a program that:
However, there's a catch! User input from the prompt function is always a string. If you don't convert the inputs to numbers, the + operator will concatenate the inputs as strings instead of adding them as numbers.
You can run the associated code sample to see what happens when you forget to convert the inputs to numbers. Then, fix the code to calculate the correct total fuel available!
You can refer to the following code sample from the previous exercise for an example of how to do this:
let convertedNum1 = Number(num1);
let convertedNum2 = Number(num2);
let sum = convertedNum1 + convertedNum2;
Output (Console)