I suspect that the exercise which inspired this question gave a restricted domain in order to narrow down the answer. I will proceed with only the given information.
I have engaged in some pedantics and many steps here so as to provide clear explanation.
I have provided some commentary below the picture. Alas, my laptop is very old and so it's inbuilt camera leaves much to be desired.
Sin(x) = 3/5. Thus, Sin(x) is positive. Since the hypotenuse is always positive and Sin(x) is positive, the y-value is positive as well. Therefore the angle is in the first or second quadrant. Diagrams are drawn illustrating both of these possibilities.
Note that the sides are labelled "3a" and "5a" as opposed to merely "3" and "5". This is because, technically, you are only given that the ratio of the sides is 3:5 and not that the sides actually are of lengths 3 and 5. This distinction has rarely mattered in typical questions in my experience, but I thought I would note it anyway.
Since the angle is denoted with "x" I have chosen to use "ajd" to denote the adj side so as to hopefully reduce confusion.
Utilizing the theorem of Pythagoras and some simply algebraic manipulation we arrive at a value for the adjacent in terms of a. In other words, we know it's size in terms of the other size, so now we can just put it into the cos(x) expression to determine the cos ratio.
I have provided an alternative method I have devised. I never see it used for some reason. Perhaps it is considered less simple or intuitive.
Anyway, we simply square both sides of the starting equation and then use the identity "sin^2 + cos^2" = 1 (thus sin^2 = 1 - cos^2. I have omitted the "(x)" for clarity's sake) and finish with some simple algebraic manipulation.
We arrive at the same answer: +- 4/5.
We have two answers because either one satisfies the given constraints. The positive answer refers to the quadrant I case and the negative answer refers to the quadrant II case.
In a more typical question the domain would have been restricted so as not to include both quadrants I and II. Thus in that case only one of the roots would have been a proper answer as the other root would refer to a quadrant not in the given domain.