QuestionDetails: Part A. Write a function called “deleteRepeats” thathas a parti
ID: 3615491 • Letter: Q
Question
QuestionDetails: Part A. Write a function called “deleteRepeats” thathas a partially filled array of characters as a formal parameterand that deletes all repeated letters from the array. Since apartially filled array requires two formal parameters: an arrayparameter and an actual number of data in the array. When a letteris deleted, the remaining letters are moved forward to fill in thegap. This will create empty positions at the end of array so thatless of the array is used. This second parameter should be acall-by-reference parameter and will be changed to show how much ofthe array is used after the repeated letters are deleted.You need to read in from a file to fill in the partially filledarray. Program asks for the file name and then user types in asshow below.
Program> Please enter the data file name: data1.txt (underlinedparts are typed in by user)
The data1.txt can look like this. (The first one is the number ofthe data items and then each character is separated by a space)
11 A b a c b e d f g h e
After the code is executed, the result should be displayed asbelow.
A b a c e d f g h e
As you can see, A? and a? are considered as different. QuestionDetails:
Explanation / Answer
please rate - thanks #include #include using namespace std; void print(char[],int); void deleteRepeats(char[],int &); int main() {char filename[30],a[80]; int i,n; coutfilename; ifstream in; in.open(filename); //open file if(in.fail()) //is it ok? { coutn; while(in) { for(i=0;i>a[i]; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.