Help with inserting code in CodeChef

Hi guys I am new in this website,I am a beginner with front end development. I have already subscribed to other challenges platforms.but I cannot get how this one works in terms of inserting the code in order to make it successfully works.
There are things like “readlines” etc and I don’t know how to analyze the code in order to see it.
For istance I have just solved the problem “Id and Ship” with the following problem code :

Here my solution which it works btw as output,but it does not work on the website (Instead of console.log I have inserted print because I noticed it is used for printing output)

class letterClassId {
constructor(letter) {
this.letter = letter;

printId() {
if (this.letter === “B” || this.letter === “b”) print(“BattleShip”);
if (this.letter === “C” || this.letter === “c”) print(“Cruiser”);
if (this.letter === “D” || this.letter === “d”) print(“Destroyer”);
if (this.letter === “F” || this.letter === “f”) print(“Frigate”);


let newShip = new letterClassId(“B”).printId();

have u selected the correct language while running/submitting the code

Of course I did it my friend. But there are lines such as (read.line() ) etc that I don’t know how to interact with.
For istance :

var rd=new BufferedReader(new InputStreamReader(;
var t=rd.readLine();
var line =rd.readLine();

except the method parseint I don’t know what those other things mean, and why should I use the readLine() method ? I can undestand it is used for reading data,but why is it included in js ? Thanks

i don’t know that much about js ,as i am a beginner in Web Dev myself, looking into it how did u input the data without using prompt?