Write a function called deleteRepeats that has a partially filled array of characters as a formal parameter and that deletes all repeated letters from the array. void deleteRepeats (char A[], int& size) Size of array A

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
icon
Related questions
Question
100%

Use C++ don't change the main function just complete the deleteRepeats function

#include <iostream>
using namespace std;
void deleteRepeats (char[], int&);
int main()
}
char alpha[10];
alpha [0] = 'm';
alpha[1] = 't¹;
alpha [2] = 't';
alpha [3]
alpha [4]
alpha [5] = 'm';
'a';
'd';
alpha [6] = 'c';
alpha [7] = 'c';
alpha [8] = 'a';
Copy the main code and complete delete Repeats function.
int size = 9;
deleteRepeats (alpha, size);
cout << "After deleting repeat" << endl;
for (int i = 0; i < size; ++i)
cout << alpha[1] << endl;
return 0;
C500 LARS
Transcribed Image Text:#include <iostream> using namespace std; void deleteRepeats (char[], int&); int main() } char alpha[10]; alpha [0] = 'm'; alpha[1] = 't¹; alpha [2] = 't'; alpha [3] alpha [4] alpha [5] = 'm'; 'a'; 'd'; alpha [6] = 'c'; alpha [7] = 'c'; alpha [8] = 'a'; Copy the main code and complete delete Repeats function. int size = 9; deleteRepeats (alpha, size); cout << "After deleting repeat" << endl; for (int i = 0; i < size; ++i) cout << alpha[1] << endl; return 0; C500 LARS
Problem 2.
Write a function called deleteRepeats that has a partially filled array of
characters as a formal parameter and that deletes all repeated letters
from the array.
void deleteRepeats (char A[], int& size)
↑
Size of array A
Problem 2.
char alpha[10];
alpha [0] = 'a';
alpha[1] = 'b';
alpha [2] = 'c'; After deleting repeat
a
alpha[3] = 'a';
alpha[4] = 'd';
alpha [5] = 'a';
alpha[6] = 'c';
alpha [7] = 'e';
int size= 8;
HALUTE
С
e
CS 003 LABS
char alpha[10];
alpha [0] = 'm'
alpha [1] = 't'
alpha [2] = 't'
alpha [3] = 'a'
alpha [4] = 'd'
alpha [5] = 'm'
alpha [6] = 'c'
alpha [7] = 'c';
alpha [8] = 'a';
int size= 9;
After deleting repeat
m
t
Transcribed Image Text:Problem 2. Write a function called deleteRepeats that has a partially filled array of characters as a formal parameter and that deletes all repeated letters from the array. void deleteRepeats (char A[], int& size) ↑ Size of array A Problem 2. char alpha[10]; alpha [0] = 'a'; alpha[1] = 'b'; alpha [2] = 'c'; After deleting repeat a alpha[3] = 'a'; alpha[4] = 'd'; alpha [5] = 'a'; alpha[6] = 'c'; alpha [7] = 'e'; int size= 8; HALUTE С e CS 003 LABS char alpha[10]; alpha [0] = 'm' alpha [1] = 't' alpha [2] = 't' alpha [3] = 'a' alpha [4] = 'd' alpha [5] = 'm' alpha [6] = 'c' alpha [7] = 'c'; alpha [8] = 'a'; int size= 9; After deleting repeat m t
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr