Hey - working on an assignment and what I need to do is create a prompt for a value and then take that value and do two functions with it. So an example of what I'm trying to do is prompt for a value which I'll enter 2 and then multiple that by 2 and display the result. After that function I want to take the value I entered and multiple it by 6 and then display that function.

I was able to do it by declaring the variable twice but that doesn't make sense? When I declare the variable once it will take (2*2) and then multiply that by 6. When really I want to multiply 2 by 2 and then 2 by 6

Here is my code

This will take number and multiply it by two and then take the answer from that function and multiply it by 6. Is there a way were I can prompt once and take that value and multiply it by 2 and then multiply the same value entered by 6?

I was able to do it by declaring the variable twice but that doesn't make sense? When I declare the variable once it will take (2*2) and then multiply that by 6. When really I want to multiply 2 by 2 and then 2 by 6

Here is my code

Code:

```
function new()
{
var number = prompt("Enter a number" , "0");
{
number = parseFloat(number) * 2;
document.write(number + " is the result ");
}
document.write("<br />");
{
number = parseFloat(number) * 6;
document.write(number + " is the result ");
}
}
```

This will take number and multiply it by two and then take the answer from that function and multiply it by 6. Is there a way were I can prompt once and take that value and multiply it by 2 and then multiply the same value entered by 6?