These two words were written in katakana just as they sound in English, so they are loanwords. There seems to exist two purposes of using katakana in this case. First, by pronouncing them in the same way as in their original language, it has the effect of conveying the exact meanings. Also, by writing them in katakana, instead of hiragana and kanji, it has the effect of making these words easily noticeable as loanwords.
These effects are produced, because katakana are not used as frequently as hiragana or kanji in daily life, so it is easily noticeable. Also, employing the similar pronunciation, these words can be easily understandable to both Japanese and foreigners.
Japanese textbooks have been different in explaining katakana, because exact usage of katakana also seems difficult to define even for Japanese academics.