Can someone please help me convert this C++ code to Java. void Setup:: parseData
ID: 3675111 • Letter: C
Question
Can someone please help me convert this C++ code to Java.
void Setup:: parseData(ifstream& in_stream){
string next_word;
int count = 0;
//reads the file next characters until the next whitespace until no more words and the count reaches the amount you'd like
while(in_stream >> next_word && count < 5000){
//adds the word to the array at the next available position
insertElement(next_word, count);
count++;
}
}
void Setup:: insertElement(string new_word_in, int position){
transform(new_word_in.begin(), new_word_in.end(), new_word_in.begin(), ::tolower);
// creates the string memory
master_a[position] = new string;
//adds the word to the array
master_a[position]->assign(new_word_in);
length++
}