Answer: It would take 10.16 million years.
Step-by-step explanation:
Light travels at a speed
.
A light-year is the distance that light travels in vacuum in one year.
The Andromeda Galaxy is 2.54 million light-years from the Earth.
This means that

Let's say
is the speed of the ship. Then
⇒

So, we have:

⇒

⇒

So, at speed
, it would need a time of 10.16 million years.