#include using namespace std; void deleteRepeats (char[], int&); int main() { char alpha[10]; alpha[0]= 'n'; alpha[1] = 't'; alpha[2] = 't'; alpha[3]= 'a'; alpha[4] 'd'; alpha [5] = 'n'; 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[i] << endl; return 0;
#include using namespace std; void deleteRepeats (char[], int&); int main() { char alpha[10]; alpha[0]= 'n'; alpha[1] = 't'; alpha[2] = 't'; alpha[3]= 'a'; alpha[4] 'd'; alpha [5] = 'n'; 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[i] << endl; return 0;
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Use C++
![#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;
CSOLARS](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fcdbdf4c8-5459-45de-99f8-cd8d71031beb%2Fe2ecc6df-8a4a-48a6-9da4-ddee617a48e7%2Fl57kype_processed.jpeg&w=3840&q=75)
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;
CSOLARS
![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
alpha[3] = 'a';
alpha[4] = 'd';
alpha [5] = 'a';
alpha[6] = 'c';
alpha [7] = 'e';
int size= 8;
HALUTE
a
C
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fcdbdf4c8-5459-45de-99f8-cd8d71031beb%2Fe2ecc6df-8a4a-48a6-9da4-ddee617a48e7%2Fuw38le_processed.jpeg&w=3840&q=75)
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
alpha[3] = 'a';
alpha[4] = 'd';
alpha [5] = 'a';
alpha[6] = 'c';
alpha [7] = 'e';
int size= 8;
HALUTE
a
C
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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
- Recommended textbooks for youDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSONC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag…Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education