Don't understand why it wont work

The terminal says earthw is not declared in this scope but It should be since I put it in cin. Why doesn’t it work?

The purpose of the programs is to Take the weight of earth as an input and output that weight on mard

int main() {
// Add your code below

double marsw = earthw * 3.73/9.81;
double earthw;
std::cout << "Enter Earth weight in Kg: ";
std::cin >> earthw;
std::cout << "Mars weight in Kg is: " << marsw;

Code will be executed top to bottom. So, how is the first statement supposed to be evaluated? At this point, earthw has neither been declared nor initialized.

Where should the statement

double marsw = earthw * 3.73/9.81;

be placed? (Hint: Not at the top and not at the very bottom)

Thank you. kasjfd;kj